public static void InsertNONWOVEN(Sale_B_NONWOVEN _Sale_B_NONWOVEN, int SaleId, string User) { DbCommand command = Catalog_Access.CreateCommand(); command.CommandText = "sp_insertSale_B_NONWOVEN"; DbParameter param; param = command.CreateParameter(); param.ParameterName = "@SaleId"; param.Value = SaleId; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@MATERIALKHADDAR"; param.Value = _Sale_B_NONWOVEN.MATERIALKHADDAR; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@WARP"; param.Value = _Sale_B_NONWOVEN.WARP; param.DbType = DbType.Decimal; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@YARN1"; param.Value = _Sale_B_NONWOVEN.YARN1; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@YARNHD1"; param.Value = _Sale_B_NONWOVEN.YARNHD1; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@COMP1"; param.Value = _Sale_B_NONWOVEN.COMP1; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@BRAND1"; param.Value = _Sale_B_NONWOVEN.BRAND1; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@RT1"; param.Value = _Sale_B_NONWOVEN.RT1; param.DbType = DbType.Decimal; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@CONSMP1"; param.Value = _Sale_B_NONWOVEN.CONSMP1; param.DbType = DbType.Decimal; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@UNIT1"; param.Value = _Sale_B_NONWOVEN.UNIT1; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@WIDTH"; param.Value = _Sale_B_NONWOVEN.WIDTH; param.DbType = DbType.Decimal; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@WEFT"; param.Value = _Sale_B_NONWOVEN.WEFT; param.DbType = DbType.Decimal; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@YARN2"; param.Value = _Sale_B_NONWOVEN.YARN2; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@YARNHD2"; param.Value = _Sale_B_NONWOVEN.YARNHD2; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@COMP2"; param.Value = _Sale_B_NONWOVEN.COMP2; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@BRAND2"; param.Value = _Sale_B_NONWOVEN.BRAND2; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@RT2"; param.Value = _Sale_B_NONWOVEN.RT2; param.DbType = DbType.Decimal; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@MATERIALFELT"; param.Value = _Sale_B_NONWOVEN.MATERIALFELT; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@GSM1"; param.Value = _Sale_B_NONWOVEN.GSM1; param.DbType = DbType.Decimal; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@OZ1"; param.Value = _Sale_B_NONWOVEN.OZ1; param.DbType = DbType.Decimal; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@CONSMP2"; param.Value = _Sale_B_NONWOVEN.CONSMP2; param.DbType = DbType.Decimal; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@UNIT2"; param.Value = _Sale_B_NONWOVEN.UNIT2; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@txtMATERIALBURLAP"; param.Value = _Sale_B_NONWOVEN.MATERIALBURLAP; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@GSM2"; param.Value = _Sale_B_NONWOVEN.GSM2; param.DbType = DbType.Decimal; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@OZ2"; param.Value = _Sale_B_NONWOVEN.OZ2; param.DbType = DbType.Decimal; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@CONSMP3"; param.Value = _Sale_B_NONWOVEN.CONSMP3; param.DbType = DbType.Decimal; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@UNIT3"; param.Value = _Sale_B_NONWOVEN.UNIT3; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@CreatedBy"; param.Value = User; param.DbType = DbType.String; command.Parameters.Add(param); Catalog_Access.ExecuteNonQuery(command); }
public static string Insert(Sale _Sale, Sale_B_KNITTED _Sale_B_KNITTED, List<Sale_B_WOVEN> list_Sale_B_WOVEN, Sale_B_NONWOVEN _Sale_B_NONWOVEN, Sale_B_TERRY _Sale_B_TERRY, Sale_B_KNITWRIST _Sale_B_KNITWRIST, Sale_B_LEATHER _Sale_B_LEATHER) { _Sale.ID = InsertSale(_Sale); if (_Sale.ID > 0) { if (_Sale_B_KNITTED != null) InsertKNITTED(_Sale_B_KNITTED, _Sale.ID, _Sale.CreatedBy); if (list_Sale_B_WOVEN != null) foreach (Sale_B_WOVEN _Sale_B_WOVEN in list_Sale_B_WOVEN) InsertWOVEN(_Sale_B_WOVEN, _Sale.ID, _Sale.CreatedBy); if (_Sale_B_NONWOVEN != null) InsertNONWOVEN(_Sale_B_NONWOVEN, _Sale.ID, _Sale.CreatedBy); if (_Sale_B_TERRY != null) InsertTERRY(_Sale_B_TERRY, _Sale.ID, _Sale.CreatedBy); if (_Sale_B_KNITWRIST != null) InsertKNITWRIST(_Sale_B_KNITWRIST, _Sale.ID, _Sale.CreatedBy); if (_Sale_B_LEATHER != null) InsertLEATHER(_Sale_B_LEATHER, _Sale.ID, _Sale.CreatedBy); return "0"; } else { return "1"; } }
public string Submit(Sale _Sale, Sale_B_KNITTED _Sale_B_KNITTED, List<Sale_B_WOVEN> list_Sale_B_WOVEN, Sale_B_NONWOVEN _Sale_B_NONWOVEN, Sale_B_TERRY _Sale_B_TERRY, Sale_B_KNITWRIST _Sale_B_KNITWRIST, Sale_B_LEATHER _Sale_B_LEATHER) { string msg = ""; if (_Sale.ID == 0) { _Sale.CreatedBy = Session["User"].ToString(); msg = Sale_DA.Insert(_Sale, _Sale_B_KNITTED, list_Sale_B_WOVEN, _Sale_B_NONWOVEN, _Sale_B_TERRY, _Sale_B_KNITWRIST, _Sale_B_LEATHER); } else { _Sale.UpdatedBy = Session["User"].ToString(); msg = Sale_DA.Update(_Sale, _Sale_B_KNITTED, list_Sale_B_WOVEN, _Sale_B_NONWOVEN, _Sale_B_TERRY, _Sale_B_KNITWRIST, _Sale_B_LEATHER); } return msg; }
public static string Update(Sale _Sale, Sale_B_KNITTED _Sale_B_KNITTED, List<Sale_B_WOVEN> list_Sale_B_WOVEN, Sale_B_NONWOVEN _Sale_B_NONWOVEN, Sale_B_TERRY _Sale_B_TERRY, Sale_B_KNITWRIST _Sale_B_KNITWRIST, Sale_B_LEATHER _Sale_B_LEATHER) { if (UpdateSale(_Sale) == "4") { if (_Sale_B_KNITTED != null) if (_Sale_B_KNITTED.Id == 0) InsertKNITTED(_Sale_B_KNITTED, _Sale.ID, _Sale.UpdatedBy); else UpdateKNITTED(_Sale_B_KNITTED, _Sale.ID, _Sale.UpdatedBy); if (list_Sale_B_WOVEN != null) foreach (Sale_B_WOVEN _Sale_B_WOVEN in list_Sale_B_WOVEN) { if (_Sale_B_WOVEN.Id == 0) InsertWOVEN(_Sale_B_WOVEN, _Sale.ID, _Sale.UpdatedBy); else UpdateWOVEN(_Sale_B_WOVEN, _Sale.ID, _Sale.UpdatedBy); } if (_Sale_B_NONWOVEN != null) if (_Sale_B_NONWOVEN.Id == 0) InsertNONWOVEN(_Sale_B_NONWOVEN, _Sale.ID, _Sale.UpdatedBy); else UpdateNONWOVEN(_Sale_B_NONWOVEN, _Sale.ID, _Sale.UpdatedBy); if (_Sale_B_TERRY != null) if (_Sale_B_TERRY.Id == 0) InsertTERRY(_Sale_B_TERRY, _Sale.ID, _Sale.UpdatedBy); else UpdateTERRY(_Sale_B_TERRY, _Sale.ID, _Sale.UpdatedBy); if (_Sale_B_KNITWRIST != null) if (_Sale_B_KNITWRIST.Id == 0) InsertKNITWRIST(_Sale_B_KNITWRIST, _Sale.ID, _Sale.UpdatedBy); else UpdateKNITWRIST(_Sale_B_KNITWRIST, _Sale.ID, _Sale.UpdatedBy); if (_Sale_B_LEATHER != null) if (_Sale_B_LEATHER.Id == 0) InsertLEATHER(_Sale_B_LEATHER, _Sale.ID, _Sale.UpdatedBy); else UpdateLEATHER(_Sale_B_LEATHER, _Sale.ID, _Sale.UpdatedBy); return "4"; } else { return "1"; } }
public Sale_B_NONWOVEN GetNONWOVEN(int SaleId) { Sale_B_NONWOVEN _Sale_B_NONWOVEN = null; DataTable dt = Sale_DA.GetNONWOVEN(SaleId); foreach (DataRow row in dt.Rows) { _Sale_B_NONWOVEN = new Sale_B_NONWOVEN(); _Sale_B_NONWOVEN.Id = int.Parse(row["Id"].ToString()); _Sale_B_NONWOVEN.MATERIALKHADDAR = row["MATERIALKHADDAR"].ToString(); if (row["WARP"].ToString() != "") _Sale_B_NONWOVEN.WARP = float.Parse(row["WARP"].ToString()); if (row["YARN1"].ToString() != "") _Sale_B_NONWOVEN.YARN1 = int.Parse(row["YARN1"].ToString()); if (row["YARNHD1"].ToString() != "") _Sale_B_NONWOVEN.YARNHD1 = int.Parse(row["YARNHD1"].ToString()); if (row["COMP1"].ToString() != "") _Sale_B_NONWOVEN.COMP1 = int.Parse(row["COMP1"].ToString()); if (row["BRAND1"].ToString() != "") _Sale_B_NONWOVEN.BRAND1 = int.Parse(row["BRAND1"].ToString()); if (row["RT1"].ToString() != "") _Sale_B_NONWOVEN.RT1 = float.Parse(row["RT1"].ToString()); if (row["CONSMP1"].ToString() != "") _Sale_B_NONWOVEN.CONSMP1 = float.Parse(row["CONSMP1"].ToString()); if (row["UNIT1"].ToString() != "") _Sale_B_NONWOVEN.UNIT1 = int.Parse(row["UNIT1"].ToString()); if (row["WIDTH"].ToString() != "") _Sale_B_NONWOVEN.WIDTH = float.Parse(row["WIDTH"].ToString()); if (row["WEFT"].ToString() != "") _Sale_B_NONWOVEN.WEFT = float.Parse(row["WEFT"].ToString()); if (row["YARN2"].ToString() != "") _Sale_B_NONWOVEN.YARN2 = int.Parse(row["YARN2"].ToString()); if (row["YARNHD2"].ToString() != "") _Sale_B_NONWOVEN.YARNHD2 = int.Parse(row["YARNHD2"].ToString()); if (row["COMP2"].ToString() != "") _Sale_B_NONWOVEN.COMP2 = int.Parse(row["COMP2"].ToString()); if (row["BRAND2"].ToString() != "") _Sale_B_NONWOVEN.BRAND2 = int.Parse(row["BRAND2"].ToString()); if (row["RT2"].ToString() != "") _Sale_B_NONWOVEN.RT2 = float.Parse(row["RT2"].ToString()); _Sale_B_NONWOVEN.MATERIALFELT = row["MATERIALFELT"].ToString(); if (row["GSM1"].ToString() != "") _Sale_B_NONWOVEN.GSM1 = float.Parse(row["GSM1"].ToString()); if (row["OZ1"].ToString() != "") _Sale_B_NONWOVEN.OZ1 = float.Parse(row["OZ1"].ToString()); if (row["CONSMP2"].ToString() != "") _Sale_B_NONWOVEN.CONSMP2 = float.Parse(row["CONSMP2"].ToString()); if (row["UNIT2"].ToString() != "") _Sale_B_NONWOVEN.UNIT2 = int.Parse(row["UNIT2"].ToString()); _Sale_B_NONWOVEN.MATERIALBURLAP = row["txtMATERIALBURLAP"].ToString(); if (row["GSM2"].ToString() != "") _Sale_B_NONWOVEN.GSM2 = float.Parse(row["GSM2"].ToString()); if (row["OZ2"].ToString() != "") _Sale_B_NONWOVEN.OZ2 = float.Parse(row["OZ2"].ToString()); if (row["CONSMP3"].ToString() != "") _Sale_B_NONWOVEN.CONSMP3 = float.Parse(row["CONSMP3"].ToString()); if (row["UNIT3"].ToString() != "") _Sale_B_NONWOVEN.UNIT3 = int.Parse(row["UNIT3"].ToString()); } return _Sale_B_NONWOVEN; }