/// <summary> /// 作废按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void Btn_MainCancel(Object sender, EventArgs e) { string _TAKEIN_ID = tbxTAKEIN_ID.Text.ToString(); var model = TAKEIN10.SingleOrDefault(x => x.TAKEIN_ID == _TAKEIN_ID); if (model == null) { FineUI.Alert.ShowInParent("订单单号不存在", FineUI.MessageBoxIcon.Information); } //1 = 存档 2 = 核准 3 = 作废 4 = 已引入(供应商进货) switch (model.STATUS) { case 1: model.STATUS = 3; break; case 2: FineUI.Alert.ShowInParent("订单已核准,无法进行作废", FineUI.MessageBoxIcon.Information); return; case 3: model.STATUS = 1; break; case 4: FineUI.Alert.ShowInParent("订单已引入,无法进行作废", FineUI.MessageBoxIcon.Information); return; default: FineUI.Alert.ShowInParent("订单状态有误,无法进行作废", FineUI.MessageBoxIcon.Information); return; } ddlStatus.SelectedValue = model.STATUS.ToString(); string result = DetailEdit(); if (String.IsNullOrEmpty(result)) { result = MAINEdit(); } if (!String.IsNullOrEmpty(result)) { FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Error); } else { string alterMssage = ButtonCancel.Text; if (alterMssage == "取消作废") { FineUI.Alert.ShowInParent("作废成功", FineUI.MessageBoxIcon.Error); } else { FineUI.Alert.ShowInParent("取消作废成功", FineUI.MessageBoxIcon.Error); } } //FineUI.Alert.ShowInParent("核准成功", FineUI.MessageBoxIcon.Information); }
/// <summary> /// 核准按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void Btn_MainCheck(Object sender, EventArgs e) { string _TAKEIN_ID = tbxTAKEIN_ID.Text.ToString(); var model = TAKEIN10.SingleOrDefault(x => x.TAKEIN_ID == _TAKEIN_ID); if (model == null) { FineUI.Alert.ShowInParent("订单单号不存在", FineUI.MessageBoxIcon.Information); return; } //1 = 存档 2 = 核准 3 = 作废 4 = 已引入(供应商进货) switch (model.STATUS) { case 1: model.STATUS = 2; break; case 2: model.STATUS = 1; break; case 3: FineUI.Alert.ShowInParent("订单已作废,无法进行核准", FineUI.MessageBoxIcon.Information); return; case 4: FineUI.Alert.ShowInParent("订单已引入,无法进行核准", FineUI.MessageBoxIcon.Information); return; default: FineUI.Alert.ShowInParent("订单状态有误,无法核准", FineUI.MessageBoxIcon.Information); return; } ddlStatus.SelectedValue = model.STATUS.ToString(); string result = TAKEN11Edit(); if (String.IsNullOrEmpty(result)) { result = TAKEN10Edit(); } if (!String.IsNullOrEmpty(result)) { FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Error); } else { FineUI.Alert.ShowInParent("保存成功", FineUI.MessageBoxIcon.Error); } LoadTAKEN10(); LoadTAKEN11(); //FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Error); //FineUI.Alert.ShowInParent("核准成功", FineUI.MessageBoxIcon.Information); }
///// <summary> ///// 修改按钮 ///// </summary> //public void Btn_MainEdit(Object sender, EventArgs e) //{ // string result = DetailEdit(); // if (String.IsNullOrEmpty(result)) // { // result = MAINEdit(); // } // if (!String.IsNullOrEmpty(result)) // { // FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Error); // } // else // { // FineUI.Alert.ShowInParent("修改成功", FineUI.MessageBoxIcon.Error); // } //} /// <summary> /// 核准按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void Btn_MainCheck(Object sender, EventArgs e) { string _TAKEIN_ID = tbxTAKEIN_ID.Text.ToString(); var model = TAKEIN10.SingleOrDefault(x => x.TAKEIN_ID == _TAKEIN_ID); int in_status = model.STATUS; if (model == null) { FineUI.Alert.ShowInParent("订单单号不存在", FineUI.MessageBoxIcon.Information); return; } if (model.STATUS == 1) { DataTable dsCom = (DataTable)SPs.Get_MAX_Inventory_DATE().ExecuteDataTable(); DateTime dtInput = DateTime.Parse(dsCom.Rows[0]["INPUT_DATE"].ToString()); if (model.INPUT_DATE.CompareTo(dtInput) <= 0) { FineUI.Alert.ShowInParent("单据小于盘点日期,不允许盘点。盘点日期为:" + dsCom.Rows[0]["INPUT_DATE"].ToString() + "", FineUI.MessageBoxIcon.Information); return; } } //1 = 存档 2 = 核准 3 = 作废 4 = 已引入(供应商进货) switch (model.STATUS) { case 1: model.STATUS = 2; break; case 2: model.STATUS = 1; break; case 3: FineUI.Alert.ShowInParent("订单已作废,无法进行核准", FineUI.MessageBoxIcon.Information); return; case 4: FineUI.Alert.ShowInParent("订单已引入,无法进行核准", FineUI.MessageBoxIcon.Information); return; default: FineUI.Alert.ShowInParent("订单状态有误,无法核准", FineUI.MessageBoxIcon.Information); return; } ddlStatus.SelectedValue = model.STATUS.ToString(); string result = DetailEdit(); if (String.IsNullOrEmpty(result)) { tbxAPP_DATETIME.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); result = MAINEdit(); } if (String.IsNullOrEmpty(result)) { //dsCom = (DataSet)SPs.Get_Purchase00(st, et, type).ExecuteDataSet(); //更新库存,厂商验收入库是否需要更新库存,待定 if (in_status == 2) { //SPs.Update_in_back00_stock01(_TAKEIN_ID).Execute(); } else { //SPs.Update_in_back00_stock01_cancel(_TAKEIN_ID).Execute(); } } if (!String.IsNullOrEmpty(result)) { FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Error); } else { string alterMssage = ButtonCheck.Text; if (alterMssage == "反核准") { FineUI.Alert.ShowInParent("核准成功", FineUI.MessageBoxIcon.Error); } else { FineUI.Alert.ShowInParent("取消核准成功", FineUI.MessageBoxIcon.Error); } } }