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 cmd : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string command = util.GetCMDFromRequest(Request); Guid id = util.GetIDFromRequest(Request); switch (command) { case "newlabor": { //ID is workorder item so fetch workorder by it, add the labor to that item, save it and redirect //to the labor page Workorder w = Workorder.GetWorkorderByRelative(RootObjectTypes.WorkorderItem, id); WorkorderItemLabor wil = w.WorkorderItems[id].Labors.Add(w.WorkorderItems[id]); //case 816 - this is now and always has been done already at the biz object level // wil.ServiceStopDate = DateTime.Now; //wil.ServiceStartDate = DateTime.Now.AddHours(-1); //wil.ServiceRateQuantity = 1; wil.UserID = util.CurrentUserID; w.Save(); Response.Redirect("labor.aspx?id=" + wil.ID.ToString()); } break; default: util.Redirect(Session, Response, ""); break; } } //------------------ } }