internal int SaveGMTItems(LC_GmtItem aLC_GmtItem) { using (var _Context = new ERPSSL_MerchandisingEntities()) { _Context.LC_GmtItem.AddObject(aLC_GmtItem); _Context.SaveChanges(); return(aLC_GmtItem.GmtItem_Id); } }
internal int SaveGMTItems(LC_GmtItem aLC_GmtItem) { return(aOrderItemsDAL.SaveGMTItems(aLC_GmtItem)); }
// Add Items To Temporary Table protected void btnAdd_Click(object sender, EventArgs e) { try { if (gmtItemCheckBox.Checked == false) { if (gmtItemDropDownList.SelectedItem.Text == "--Select GMT Items--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Style!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Select GMT Items');", true); return; } else { gmtItemsId = Convert.ToInt32(gmtItemDropDownList.SelectedValue.ToString()); } } else if (gmtItemCheckBox.Checked == true) { if (gmtItemTextBox.Text == "") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Style!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert GMT Item');", true); return; } else { LC_GmtItem aLC_GmtItem = new LC_GmtItem(); aLC_GmtItem.Gmt_Name = gmtItemTextBox.Text; aLC_GmtItem.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; aLC_GmtItem.CreateDate = DateTime.Now; aLC_GmtItem.OCode = ((SessionUser)Session["SessionUser"]).OCode; gmtItemsId = aOrderItemsBLL.SaveGMTItems(aLC_GmtItem); } } LC_Size_Temp aLC_Size_Temp = new LC_Size_Temp(); aLC_Size_Temp.OrderNo = Convert.ToInt32(WorkOrderId.Text); aLC_Size_Temp.StyleNo = Convert.ToInt32(StyleId.Text); aLC_Size_Temp.GMTItem = Convert.ToInt32(gmtItemDropDownList.SelectedValue.ToString()); aLC_Size_Temp.Articale = articleTextBox.Text; aLC_Size_Temp.ColorID = Convert.ToInt32(ddlcolor.SelectedValue); aLC_Size_Temp.Size = sizeTextBox.Text; aLC_Size_Temp.Qty = Convert.ToInt32(quantityTextBox.Text); aLC_Size_Temp.Price = Convert.ToDecimal(rateTextBox.Text); aLC_Size_Temp.TotalAmount = Convert.ToDecimal(totalAmountTextBox.Text); aLC_Size_Temp.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; aLC_Size_Temp.CreateDate = DateTime.Now; aLC_Size_Temp.OCode = ((SessionUser)Session["SessionUser"]).OCode; int result = aOrderItemsBLL.Save_LC_To_Temp(aLC_Size_Temp); if (result != 0) { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "SuccessAlert('Item Added Successfully!!')", true); } else if (result == 0) { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Item Not Added');", true); return; } } catch { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "notsuccessalert('Not Added');", true); return; } LoadDataInGridView(); clear(); }