Files
ayanova7/source/MBI/sched2labor.aspx.cs
2018-06-29 19:47:36 +00:00

42 lines
1.5 KiB
C#

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using GZTW.AyaNova.BLL;
namespace AyaNovaMBI
{
public partial class sched2labor : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Guid id = util.GetIDFromRequest(Request);
WorkorderServiceScheduledUserList.WorkorderServiceScheduledUserListInfo i;
try
{
i = WorkorderServiceScheduledUserList.GetListForSingleItem(id)[0];
}
catch
{
throw new ApplicationException("Workorder item scheduled user ID is not valid, WorkorderServiceScheduledUserListInfo could not be retrieved");
}
//convert
Workorder w = Workorder.GetWorkorderByRelative(RootObjectTypes.WorkorderItemScheduledUser, util.GetIDFromRequest(Request));
Guid mNewWorkorderItemLabor = w.CreateLaborFromScheduledUser(i.LT_WorkorderItem_Label_ID, id);
if (mNewWorkorderItemLabor == Guid.Empty)
throw new ApplicationException("Sched2Labor: newworkorderitemlabor is empty, failed to convert scheduser to labor");
w.Save();
Response.Redirect("labor.aspx?id="+mNewWorkorderItemLabor.ToString());
}
}
}