private void InsUpdDelStockIn(char Event, int id) { var msg = ""; if (Event == 'I' || Event == 'U') { // var session=new BK_Session(int userId,) var objOrder = new OrderedItemClass(id, Convert.ToDateTime(txtDate.Text), txtDocumentNo.Text, " ", txtStockNo.Text, Convert.ToInt32((string)ddlGender.SelectedValue), Convert.ToInt32((string)ddlCategory.SelectedValue), " ", Convert.ToInt32((string)ddlStyle.SelectedValue), Convert.ToInt32((string)ddlColor.SelectedValue), Convert.ToInt32((string)ddlSize.SelectedValue), Convert.ToInt32(txtQty.Text), float.Parse(txtRate.Text), 0, float.Parse(txtMrp.Text)); var objImport = new ProductStockIn(BK_Session.GetSession().BranchId, BK_Session.GetSession().UserId, Convert.ToDateTime("1/1/1900"), " ", txtInvoiceNo.Text, txtAirwayBillNo.Text, Convert.ToInt32((string)ddlSeason.SelectedValue), Convert.ToDateTime("1/1/1900"), 0); msg = BL_Stock_In.InsUpdDelStockIn(Event, objOrder, objImport, out id); } else { var objOrder = new OrderedItemClass(id, Convert.ToDateTime("1/1/1900"), " ", " ", " ", 0, 0, " ", 0, 0, 0, 0, 0, 0, 0); var objImport = new ProductStockIn(0, 0, Convert.ToDateTime("1/1/1900"), " ", " ", " ", 0, Convert.ToDateTime("1/1/1900"), 0); msg = BL_Stock_In.InsUpdDelStockIn(Event, objOrder, objImport, out id); } if (msg == "Data Imported Successfully") { _msgbox.ShowSuccess(msg); } else { _msgbox.ShowWarning(msg); } }
public static string InsUpdDelStockIn(char Event, OrderedItemClass obj, ProductStockIn obj1, out int returnId) { returnId = 0; try { var cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "USP_IUD_TBL_STOCK_IN"; cmd.Connection = DL_CCommon.ConnectionForCommonDb(); cmd.Parameters.AddWithValue("@EVENT ", Event); cmd.Parameters.AddWithValue("@STOCKNO ", obj.StockNo); cmd.Parameters.AddWithValue("@DOCNO ", obj.DocNo); cmd.Parameters.AddWithValue("@GENDERID ", obj.GenderId); cmd.Parameters.AddWithValue("@CATEGORYID ", obj.KnittingCategoryId); cmd.Parameters.AddWithValue("@STYLEID ", obj.StyleId); cmd.Parameters.AddWithValue("@COLORID ", obj.ColorId); cmd.Parameters.AddWithValue("@SIZEID ", obj.SizeId); cmd.Parameters.AddWithValue("@QUANTITY ", obj.Qty); cmd.Parameters.AddWithValue("@RATE ", obj.ItemRate); cmd.Parameters.AddWithValue("@MRP ", obj.MrpNpr); cmd.Parameters.AddWithValue("@INDATE ", obj.Date); cmd.Parameters.AddWithValue("@InvoiceNo ", obj1.InvoiceNo); cmd.Parameters.AddWithValue("@Season ", obj1.Season); cmd.Parameters.AddWithValue("@BranchId ", obj1.BranchId); cmd.Parameters.AddWithValue("@CreatedBy ", obj1.CreatedBy); cmd.Parameters.AddWithValue("@AirwayBillNo ", obj1.AirwayBillNo); var outparameter = new SqlParameter("@MSG", SqlDbType.NVarChar, 200); outparameter.Direction = ParameterDirection.Output; cmd.Parameters.Add(outparameter); var outId = new SqlParameter("@RETURNOUTID", SqlDbType.NVarChar, 100); outId.Direction = ParameterDirection.Output; cmd.Parameters.Add(outId); cmd.ExecuteNonQuery(); var msg = cmd.Parameters[outparameter.ParameterName].Value; returnId = Convert.ToInt32(cmd.Parameters[outId.ParameterName].Value); return(Convert.ToString(msg)); } catch (Exception ex) { throw new ArgumentException(ex.Message); } finally { DL_CCommon.ConnectionForCommonDb().Close(); } }
public static string InsUpdDelStockIn(char Event, OrderedItemClass obj, ProductStockIn obj1, out int id) { id = 0; return(DlStockIn.InsUpdDelStockIn(Event, obj, obj1, out id)); }