public void changeConditionWayAfter(VagOperations vo, Way way) { if (way.Bind_cond.Id != -1) { vo.cond.Id = way.Bind_cond.Id_cond_after; } }
public void changeLoadCond(VagOperations vo, bool isShop) { if (vo.gruz.Contains("порож") && isShop) { vo.cond.Id = 6; } else { vo.cond.Id = 5; } }
public VagWaitAdmiss(VagOperations vo) { base.Create(vo); //this.id_oper = vo.id_oper; //this.num_vag_on_way = vo.num_vag_on_way; //this.dt_amkr = vo.dt_amkr; //this.dt_uz = vo.dt_uz; //Дата готовности отправки с УЗ //this.id_vag = vo.id_vag; //this.num_vag = vo.num_vag; //this.rod = vo.rod; //this.dt_on_way = vo.dt_on_way; //this.dt_on_stat = vo.dt_on_stat; //this.dt_from_stat = vo.dt_from_stat; //this.owner = vo.owner; //this.own_country = vo.own_country; //this.id_godn = vo.id_godn; //this.godn = vo.godn; //this.id_gruz = vo.id_gruz; //this.gruz = vo.gruz; //this.id_gruz_amkr = vo.id_gruz_amkr; //this.gruz_amkr = vo.gruz_amkr; //this.weight_gruz = vo.weight_gruz; //this.id_ceh_gruz = vo.id_ceh_gruz; //this.ceh_gruz = vo.ceh_gruz; //this.id_tupik = vo.id_tupik; //this.tupik = vo.tupik; //this.id_gdstait = vo.id_gdstait; //this.gdstait = vo.gdstait; //this.id_nazn_country = vo.id_nazn_country; //this.nazn_country = vo.nazn_country; //this.note = vo.note; //this.outer_station = vo.outer_station; //this.cond = vo.cond; //this.grvuSAP = vo.grvuSAP; //this.ngruSAP = vo.ngruSAP; //this.MailDate = vo.MailDate; //this.MailNum = vo.MailNum; //this.MailText = vo.MailText; //this.MailStat = vo.MailStat; //this.MailSobstv = vo.MailSobstv; }
public VagWaitRemoveAdmiss(VagOperations vo) { base.Create(vo); //this.id_oper = vo.id_oper ;// //this.dt_uz = vo.dt_uz ;// //this.dt_amkr = vo.dt_amkr ;// //this.dt_out_amkr = vo.dt_out_amkr ;// //this.id_sostav = vo.id_sostav ;// //this.id_vag = vo.id_vag ;//TODO: Убрать переход на новый справочник Wagons //this.num_vag = vo.num_vag ;// //this.dt_on_stat = vo.dt_on_stat ;// //this.dt_from_stat = vo.dt_from_stat ;// //this.dt_on_way = vo.dt_on_way ;// //this.dt_from_way = vo.dt_from_way ;// //this.num_vag_on_way = vo.num_vag_on_way ;// //this.id_godn = vo.id_godn ;// //this.godn = vo.godn ;// //this.cond = vo.cond ;// //this.grvuSAP = vo.grvuSAP ;// //this.ngruSAP = vo.ngruSAP ;// //// Справочник Wagons //this.rod = vo.rod ;// //this.owner = vo.owner ;// //this.own_country = vo.own_country ;// ////Cправочник САП вх. поставки //this.id_gruz = vo.id_gruz ;// //this.gruz = vo.gruz ;// //this.weight_gruz = vo.weight_gruz ;// //this.id_ceh_gruz = vo.id_ceh_gruz ;// //this.ceh_gruz = vo.ceh_gruz ;// //this.outer_station = vo.outer_station ;// ////Cправочник САП выход. поставки //TODO: Переделать переход на новый справочник САП выход. поставки //this.id_gruz_amkr = vo.id_gruz_amkr ;// //this.gruz_amkr = vo.gruz_amkr ;// //this.id_tupik = vo.id_tupik ;// //this.tupik = vo.tupik ;// //this.id_gdstait = vo.id_gdstait ;// //this.gdstait = vo.gdstait ;// //this.id_nazn_country = vo.id_nazn_country ;// //this.nazn_country = vo.nazn_country ;// //this.note = vo.note ;// //// Справочник писем //this.MailDate = vo.MailDate ;// //this.MailNum = vo.MailNum ;// //this.MailText = vo.MailText ;// //this.MailStat = vo.MailStat ;// //this.MailSobstv = vo.MailSobstv ;// //this.id_oper = vo.id_oper; //this.num_vag_on_way = vo.num_vag_on_way; //this.dt_amkr = vo.dt_amkr; //this.id_vag = vo.id_vag; //this.num_vag = vo.num_vag; //this.rod = vo.rod; //this.dt_on_way = vo.dt_on_way; //this.owner = vo.owner; //this.own_country = vo.own_country; //this.id_godn = vo.id_godn; //this.godn = vo.godn; //this.id_gruz = vo.id_gruz; //this.gruz = vo.gruz; //this.id_gruz_amkr = vo.id_gruz_amkr; //this.gruz_amkr = vo.gruz_amkr; //this.weight_gruz = vo.weight_gruz; //this.id_ceh_gruz = vo.id_ceh_gruz; //this.ceh_gruz = vo.ceh_gruz; //this.id_tupik = vo.id_tupik; //this.tupik = vo.tupik; //this.id_gdstait = vo.id_gdstait; //this.gdstait = vo.gdstait; //this.id_nazn_country = vo.id_nazn_country; //this.nazn_country = vo.nazn_country; //this.note = vo.note; //this.outer_station = vo.outer_station; //this.cond = vo.cond; //this.grvuSAP = vo.grvuSAP; //this.ngruSAP = vo.ngruSAP; //this.MailDate = vo.MailDate; //this.MailNum = vo.MailNum; //this.MailText = vo.MailText; //this.MailStat = vo.MailStat; //this.MailSobstv = vo.MailSobstv; }
/// <summary> /// Параметры для добавления информации по вагонам /// </summary> /// <param name="vo"></param> /// <param name="way"></param> /// <param name="addParamsCount"></param> /// <returns></returns> protected SqlParameter[] paramsForInsert(VagOperations vo, Way way, int addParamsCount) { SqlParameter[] sqlParameters = new SqlParameter[17 + addParamsCount]; sqlParameters[0] = new SqlParameter("@id_vagon", vo.id_vag); sqlParameters[1] = new SqlParameter("@id_stat", way.Stat.ID); sqlParameters[2] = new SqlParameter("@id_way", way.ID); sqlParameters[3] = new SqlParameter("@num_vag_on_way", vo.num_vag_on_way); // Номер вагона на пути if (vo.dt_amkr < DateTime.Parse("1900-01-01 00:00") | (vo.dt_amkr == null)) { sqlParameters[4] = new SqlParameter("@dt_amkr", DBNull.Value); } else { sqlParameters[4] = new SqlParameter("@dt_amkr", vo.dt_amkr); } sqlParameters[5] = new SqlParameter("@id_oper", vo.id_oper); if (vo.id_godn != -1) { sqlParameters[6] = new SqlParameter("@id_cond", vo.id_godn); // годность по прибытию } else { sqlParameters[6] = new SqlParameter("@id_cond", DBNull.Value); } if (vo.id_gruz != -1) { sqlParameters[7] = new SqlParameter("@id_gruz", vo.id_gruz); // груз } else { sqlParameters[7] = new SqlParameter("@id_gruz", DBNull.Value); } sqlParameters[8] = new SqlParameter("@weight_gruz", vo.weight_gruz); // вес if (vo.id_ceh_gruz != -1) { sqlParameters[9] = new SqlParameter("@id_shop_gruz_for", vo.id_ceh_gruz); // } else { sqlParameters[9] = new SqlParameter("@id_shop_gruz_for", DBNull.Value); } if (vo.id_tupik != -1) { sqlParameters[10] = new SqlParameter("@id_tupik", vo.id_tupik); //тупик } else { sqlParameters[10] = new SqlParameter("@id_tupik", DBNull.Value); } if (vo.id_nazn_country != -1) { sqlParameters[11] = new SqlParameter("@id_nazn_country", vo.id_nazn_country); // страна назначения } else { sqlParameters[11] = new SqlParameter("@id_nazn_country", DBNull.Value); } if (vo.id_gdstait != -1) { sqlParameters[12] = new SqlParameter("@id_gdstait", vo.id_gdstait); //станция грузов доставки } else { sqlParameters[12] = new SqlParameter("@id_gdstait", DBNull.Value); } sqlParameters[13] = new SqlParameter("@note", vo.note); // примечание груз sqlParameters[14] = new SqlParameter("@grvuSAP", vo.grvuSAP); // sqlParameters[15] = new SqlParameter("@ngruSAP", vo.ngruSAP); // sqlParameters[16] = new SqlParameter("@num_vagon", vo.num_vag); // return(sqlParameters); }
protected List <VagOperations> getVagons(DataTable table) { List <VagOperations> list = new List <VagOperations>(); foreach (DataRow row in table.Rows) { double?wr = null; if (row["WeightReweighing"] != DBNull.Value) { wr = Double.Parse(row["WeightReweighing"].ToString()); } VagOperations vagOperations = new VagOperations() { // Общая информация //id_oper = -1, //TODO:Сделал определение id_oper (для закрытия старой записи) id_oper = row["id_oper"] != DBNull.Value ? int.Parse(row["id_oper"].ToString()) : -1, dt_uz = row["dt_uz"] != DBNull.Value ? row["dt_uz"] as DateTime? : null, dt_amkr = row["dt_amkr"] != DBNull.Value ? row["dt_amkr"] as DateTime? : null, dt_out_amkr = row["dt_out_amkr"] != DBNull.Value ? row["dt_out_amkr"] as DateTime? : null, id_sostav = row["IDSostav"] != DBNull.Value ? int.Parse(row["IDSostav"].ToString()): -1, id_vag = row["id_vagon"] != DBNull.Value ? int.Parse(row["id_vagon"].ToString()): -1, num_vag = row["num_vagon"] != DBNull.Value ? int.Parse(row["num_vagon"].ToString()) : -1, //id_stat = row["id_stat"] != DBNull.Value ? int.Parse(row["id_stat"].ToString()) : -1, dt_on_stat = row["dt_on_stat"] != DBNull.Value ? row["dt_on_stat"] as DateTime? : null, dt_from_stat = row["dt_from_stat"] != DBNull.Value ? row["dt_from_stat"] as DateTime? : null, dt_on_way = row["dt_on_way"] != DBNull.Value ? row["dt_on_way"] as DateTime? : null, dt_from_way = row["dt_from_way"] != DBNull.Value ? row["dt_from_way"] as DateTime? : null, num_vag_on_way = row["num_vag_on_way"] != DBNull.Value ? int.Parse(row["num_vag_on_way"].ToString()) : -1, id_godn = row["id_cond"] != DBNull.Value ? int.Parse(row["id_cond"].ToString()) : -1, godn = row["cond"] != DBNull.Value ? row["cond"] as string : "", cond = new Cond() { Id = row["id_cond2"] != DBNull.Value ? int.Parse(row["id_cond2"].ToString()) : -1, Name = row["cond2"] != DBNull.Value ? row["cond2"] as string : "", Id_cond_after = row["id_cond_after"] != DBNull.Value ? int.Parse(row["id_cond_after"].ToString()) : -1, }, grvuSAP = row["grvu_SAP"] != DBNull.Value ? row["grvu_SAP"] as string : "", ngruSAP = row["ngru_SAP"] != DBNull.Value ? row["ngru_SAP"] as string : "", // Справочник Wagons rod = row["rod"] != DBNull.Value ? row["rod"] as string : "", owner = row["owner_"] != DBNull.Value ? row["owner_"] as string : "", own_country = row["country"] != DBNull.Value ? row["country"] as string : "", wagon_country = row["wagon_country"] != DBNull.Value ? row["wagon_country"] as string : "", //Cправочник САП вх. поставки id_gruz = row["id_gruz"] != DBNull.Value ? int.Parse(row["id_gruz"].ToString()) : -1, gruz = row["gruz"] != DBNull.Value ? row["gruz"] as string : "", weight_gruz = row["weight_gruz"] != DBNull.Value ? Double.Parse(row["weight_gruz"].ToString()) : 0, id_ceh_gruz = row["id_shop_gruz_for"] != DBNull.Value ? int.Parse(row["id_shop_gruz_for"].ToString()) : -1, ceh_gruz = row["shop"] != DBNull.Value ? row["shop"] as string : "", outer_station = row["st_otpr"] != DBNull.Value ? row["st_otpr"] as string : "", NumNakl = row["NumNakl"] != DBNull.Value ? row["NumNakl"].ToString().Trim() : "", // Номер накладной CargoName = row["CargoName"] != DBNull.Value ? row["CargoName"].ToString().Trim() : "", WeightDoc = row["WeightDoc"] != DBNull.Value ? Double.Parse(row["WeightDoc"].ToString()) : 0, DocNumReweighing = row["DocNumReweighing"] != DBNull.Value ? row["DocNumReweighing"] as int? : null, // Номер отвесной DocDataReweighing = row["DocDataReweighing"] != DBNull.Value ? row["DocDataReweighing"] as DateTime? : null, WeightReweighing = wr, DateTimeReweighing = row["DateTimeReweighing"] != DBNull.Value ? row["DateTimeReweighing"] as DateTime? : null, CodeMaterial = row["CodeMaterial"] != DBNull.Value ? row["CodeMaterial"].ToString().Trim() : "", NameMaterial = row["NameMaterial"] != DBNull.Value ? row["NameMaterial"].ToString().Trim() : "", CodeStationShipment = row["CodeStationShipment"] != DBNull.Value ? row["CodeStationShipment"].ToString().Trim() : "", NameStationShipment = row["NameStationShipment"] != DBNull.Value ? row["NameStationShipment"].ToString().Trim() : "", CodeShop = row["CodeShop"] != DBNull.Value ? row["CodeShop"].ToString().Trim() : "", NameShop = row["NameShop"] != DBNull.Value ? row["NameShop"].ToString().Trim() : "", CodeNewShop = row["CodeNewShop"] != DBNull.Value ? row["CodeNewShop"].ToString().Trim() : "", NameNewShop = row["NameNewShop"] != DBNull.Value ? row["NameNewShop"].ToString().Trim() : "", PermissionUnload = row["PermissionUnload"] != DBNull.Value ? bool.Parse(row["PermissionUnload"].ToString()) ? "Разрешено" : "Запрещено" : "Запрещено", Step1 = row["Step1"] != DBNull.Value ? bool.Parse(row["Step1"].ToString()) : false, Step2 = row["Step2"] != DBNull.Value ? bool.Parse(row["Step2"].ToString()) : false, //Cправочник САП выход. поставки //TODO: Переделать переход на новый справочник САП выход. поставки id_gruz_amkr = row["id_gruz_amkr"] != DBNull.Value ? int.Parse(row["id_gruz_amkr"].ToString()) : -1, gruz_amkr = row["gruz_amkr"] != DBNull.Value ? row["gruz_amkr"] as string : "", id_tupik = row["id_tupik"] != DBNull.Value ? int.Parse(row["id_tupik"].ToString()) : -1, tupik = row["tupik"] != DBNull.Value ? row["tupik"] as string : "", id_gdstait = row["id_gdstait"] != DBNull.Value ? int.Parse(row["id_gdstait"].ToString()) : -1, gdstait = row["gdstait"] != DBNull.Value ? row["gdstait"] as string : "", id_nazn_country = row["id_nazn_country"] != DBNull.Value ? int.Parse(row["id_nazn_country"].ToString()) : -1, nazn_country = row["nazn_country"] != DBNull.Value ? row["nazn_country"] as string : "", note = row["note"] != DBNull.Value ? row["note"] as string : "", // Справочник писем MailDate = row["date_mail"] != DBNull.Value ? row["date_mail"] as DateTime? : null, MailNum = row["n_mail"] != DBNull.Value ? row["n_mail"].ToString().Trim() : "", MailText = row["text"] != DBNull.Value ? row["text"].ToString().Trim() : "", MailStat = row["nm_stan"] != DBNull.Value ? row["nm_stan"].ToString().Trim() : "", MailSobstv = row["nm_sobstv"] != DBNull.Value ? row["nm_sobstv"].ToString().Trim() : "", }; list.Add(vagOperations); } return(list); }
public void changeLoadCondAfter(VagOperations vo) { vo.cond.Id = vo.cond.Id_cond_after; }
} // { get; set; } protected void Create(VagOperations vo) { this.id_oper = vo.id_oper; // this.dt_uz = vo.dt_uz; // this.dt_amkr = vo.dt_amkr; // this.dt_out_amkr = vo.dt_out_amkr; // this.id_sostav = vo.id_sostav; // this.id_vag = vo.id_vag; //TODO: Убрать переход на новый справочник Wagons this.num_vag = vo.num_vag; // //this.id_stat = vo.id_stat;// this.dt_on_stat = vo.dt_on_stat; // this.dt_from_stat = vo.dt_from_stat; // this.dt_on_way = vo.dt_on_way; // this.dt_from_way = vo.dt_from_way; // this.num_vag_on_way = vo.num_vag_on_way; // this.id_godn = vo.id_godn; // this.godn = vo.godn; // this.cond = vo.cond; // this.grvuSAP = vo.grvuSAP; // this.ngruSAP = vo.ngruSAP; // // Справочник Wagons this.rod = vo.rod; // this.owner = vo.owner; // this.own_country = vo.own_country; // this.wagon_country = vo.wagon_country; // страна вагона //Cправочник САП вх. поставки this.id_gruz = vo.id_gruz; // this.gruz = vo.gruz; // this.weight_gruz = vo.weight_gruz; // this.id_ceh_gruz = vo.id_ceh_gruz; // this.ceh_gruz = vo.ceh_gruz; // this.outer_station = vo.outer_station; // this.NumNakl = vo.NumNakl; // номер накладной this.CargoName = vo.CargoName; // Груз this.WeightDoc = vo.WeightDoc; this.DocNumReweighing = vo.DocNumReweighing; this.DocDataReweighing = vo.DocDataReweighing; this.WeightReweighing = vo.WeightReweighing; this.DateTimeReweighing = vo.DateTimeReweighing; this.CodeMaterial = vo.CodeMaterial; this.NameMaterial = vo.NameMaterial; this.CodeStationShipment = vo.CodeStationShipment; this.NameStationShipment = vo.NameStationShipment; this.CodeShop = vo.CodeShop; this.NameShop = vo.NameShop; this.CodeNewShop = vo.CodeNewShop; this.NameNewShop = vo.NameNewShop; this.PermissionUnload = vo.PermissionUnload; this.Step1 = vo.Step1; this.Step2 = vo.Step2; //Cправочник САП выход. поставки //TODO: Переделать переход на новый справочник САП выход. поставки this.id_gruz_amkr = vo.id_gruz_amkr; // this.gruz_amkr = vo.gruz_amkr; // this.id_tupik = vo.id_tupik; // this.tupik = vo.tupik; // this.id_gdstait = vo.id_gdstait; // this.gdstait = vo.gdstait; // this.id_nazn_country = vo.id_nazn_country; // this.nazn_country = vo.nazn_country; // this.note = vo.note; // // Справочник писем this.MailDate = vo.MailDate; // this.MailNum = vo.MailNum; // this.MailText = vo.MailText; // this.MailStat = vo.MailStat; // this.MailSobstv = vo.MailSobstv; // }