/************************************************************* * 取引先の登録処理を行う *************************************************************/ private void executeAppendSupplier(CostAccountingEntities context) { int category = (int)Program.judgeCategory(radioBudget, radioActual); // 取引先データの登録 var entitySupplier = new ProductSupplier() { year = Const.TARGET_YEAR, product_code = productCode.Text, supplier_code = suppllierCode.Text, category = category, type = (int)Const.PRODUCT_TYPE.Normal, unit_price = Conversion.Parse(unitPrice.Text), update_user = string.Concat(SystemInformation.ComputerName, "/", SystemInformation.UserName), update_date = DateTime.Now, del_flg = Const.FLG_OFF }; context.ProductSupplier.Add(entitySupplier); // 荷造運賃 int no = 0; foreach (DataGridViewRow row in dgvPackingFare.Rows) { string code = (string)row.Cells["dgvPackingFareName"].Value; if (!String.IsNullOrEmpty(code)) { var entity = new ProductPackingFare() { year = Const.TARGET_YEAR, product_code = productCode.Text, supplier_code = suppllierCode.Text, category = category, no = no++, code = code, quantity = Conversion.Parse((string)row.Cells["dgvPackingFareQuantity"].Value), update_user = string.Concat(SystemInformation.ComputerName, "/", SystemInformation.UserName), update_date = DateTime.Now, del_flg = Const.FLG_OFF }; context.ProductPackingFare.Add(entity); } } }
/************************************************************* * 取引先の登録処理を行う *************************************************************/ private void executeAppendSupplier(CostAccountingEntities context) { int category = (int)Program.judgeCategory(radioBudget, radioActual); // 取引先データの登録 var entitySupplier = new ProductSupplier() { year = Const.TARGET_YEAR, product_code = productCode.Text, supplier_code = suppllierCode.Text, category = category, type = (int)Const.PRODUCT_TYPE.Blend, unit_price = Conversion.Parse(unitPrice.Text), update_user = string.Concat(SystemInformation.ComputerName, "/", SystemInformation.UserName), update_date = DateTime.Now, del_flg = Const.FLG_OFF }; context.ProductSupplier.Add(entitySupplier); }