protected void Submit(string status) { Model.GoodsMaintain goods = new LabMS.Model.GoodsMaintain(); BLL.GoodsMaintain bgoods = new LabMS.BLL.GoodsMaintain(); goods.LabName = tbLabNum.Text.Trim(); goods.AssetManagers = tbManager.Text.Trim(); goods.Tel = tbTelNum.Text.Trim(); goods.Numbers = tbLowNum.Text.Trim(); goods.Name = tbLowname.Text.Trim(); goods.StorageSites = tbStoreAdd.Text.Trim(); goods.Applicant = tbApplyer.Text.Trim(); goods.Guarantee = isInTime.SelectedValue; DateTime tempTime = new DateTime(); if (DateTime.TryParse(tbReportTime.Text.Trim(), out tempTime)) { goods.ReportedTime = tempTime; } goods.Describe = tbDescription.Text.Trim(); goods.Status = status; try { bgoods.Add(goods); LabMS.Common.JShelper.JSAlertAndRedirect(Page, "AddSuccess", "操作成功!", "valuablesdamagereport.aspx"); } catch (Exception ex) { Err.Text = ex.Message.ToString(); } }
protected void savedata(string status) { if (tbInstrumentName.Text.Trim() == "") { LabMS.Common.JShelper.JSAlert(Page, "err", "仪器不可以为空!"); return; } if (tbApplyer.Text.Trim() == "") { LabMS.Common.JShelper.JSAlert(Page, "err", "申请人不可以为空!"); return; } BLL.GoodsMaintain binstrument = new LabMS.BLL.GoodsMaintain(); Model.GoodsMaintain instrment = new LabMS.Model.GoodsMaintain(); instrment.Numbers = tbInstrumentNum.Text; instrment.Name = tbInstrumentName.Text; instrment.AssetManagers = tbManager.Text.Trim(); instrment.Tel = tbTelNum.Text; instrment.StorageSites = tbLocation.Text; //ddlStockLocation.SelectedValue; instrment.LabName = ddlLab.SelectedValue; instrment.Guarantee = isInTime.SelectedValue; instrment.Applicant = tbApplyer.Text.Trim(); instrment.ReportedTime = DateTime.Parse( tbReportTime.Text); instrment.Describe = tbDescription.Text; instrment.Status = status.ToString().Trim(); BLL.InstrumentAndConsumables bins = new LabMS.BLL.InstrumentAndConsumables(); Model.InstrumentAndConsumables ins = (bins.GetModelList(" Numbers="+tbInstrumentNum.Text.Trim()))[0]; ins.PresentSituation = status; int i = Convert.ToInt32(ins.Quantity); i--; ins.Quantity = i; try { bins.Update(ins); } catch (Exception e) { LabMS.Common.JShelper.JSAlert(Page, "err", "添加失败1"); return; } try { binstrument.Add(instrment); } catch (Exception ee) { LabMS.Common.JShelper.JSAlert(Page, "err", "添加失败2"+ee.Message); return; } LabMS.Common.JShelper.JSAlertAndRedirect(Page, "err", "添加成功", "lowdamagereport.aspx"); }
protected void bind(string strid) { BLL.GoodsMaintain bgoodsmaintain = new LabMS.BLL.GoodsMaintain(); Model.GoodsMaintain goodsmaintain = bgoodsmaintain.GetModel(Convert.ToInt32(strid)); ddlLab.SelectedValue = goodsmaintain.LabName; tbManager.Text = goodsmaintain.AssetManagers; tbTelNum.Text = goodsmaintain.Tel; tbinstrumentNum.Text = goodsmaintain.Numbers; tbisntrumentname.Text = goodsmaintain.Name; tbIsInTime.SelectedValue = goodsmaintain.Guarantee; tbApplyer.Text = goodsmaintain.Applicant; tbReportTime.Text = goodsmaintain.ReportedTime.ToString(); tbDescription.Text = goodsmaintain.Describe; tbLocation.Text = goodsmaintain.StorageSites; }
protected void bind(string strid) { BLL.GoodsMaintain bgoodsmaintain = new LabMS.BLL.GoodsMaintain(); Model.GoodsMaintain goodsmaintain = bgoodsmaintain.GetModel(Convert.ToInt32(strid)); ddlLab.SelectedValue = goodsmaintain.LabName; tbManager.Text = goodsmaintain.AssetManagers; tbTelNum.Text = goodsmaintain.Tel; tbinstrumentNum.Text = goodsmaintain.Numbers; tbisntrumentname.Text = goodsmaintain.Name; tbIsInTime.SelectedValue = goodsmaintain.Guarantee; tbApplyer.Text = goodsmaintain.Applicant; tbReportTime.Text = goodsmaintain.ReportedTime.ToString(); tbDescription.Text = goodsmaintain.Describe; tbLocation.Text = goodsmaintain.StorageSites; tbRepairGroup.Text = goodsmaintain.MCo; tbTransfer.Text = goodsmaintain.MLinkman; tbPhoneNum.Text = goodsmaintain.MPhone; tbComments.Text = goodsmaintain.MComment; if (!goodsmaintain.MDate.ToString().Equals("")) tbRepairTime.Text = goodsmaintain.MDate.ToString(); }
private void savedata(string status) { BLL.GoodsMaintain bgoodsmaintain = new LabMS.BLL.GoodsMaintain(); Model.GoodsMaintain goodsmaintain = bgoodsmaintain.GetModel(Convert.ToInt32(strID.Text)); goodsmaintain.MCo = tbRepairGroup.Text; goodsmaintain.MLinkman = tbTransfer.Text.Trim(); goodsmaintain.MPhone = tbPhoneNum.Text; goodsmaintain.MComment = tbComments.Text; if (!tbRepairTime.Text.Trim().Equals("")) { goodsmaintain.MDate = DateTime.Parse(tbRepairTime.Text); } goodsmaintain.LabName = ddlLab.SelectedValue; goodsmaintain.AssetManagers = tbManager.Text; goodsmaintain.Tel = tbTelNum.Text; goodsmaintain.Guarantee = tbIsInTime.SelectedValue; goodsmaintain.Applicant = tbApplyer.Text.Trim(); goodsmaintain.Describe = tbDescription.Text; goodsmaintain.Status = status; goodsmaintain.AcceptanceViews = tbAcceptanceViews.Text; BLL.InstrumentAndConsumables biac = new LabMS.BLL.InstrumentAndConsumables(); Model.InstrumentAndConsumables iac; if (biac.GetModelList(" Numbers=" + tbinstrumentNum.Text.Trim()).Count != 0) { iac = biac.GetModelList(" Numbers=" + tbinstrumentNum.Text.Trim())[0]; try { bgoodsmaintain.Update(goodsmaintain); } catch (Exception e) { Common.JShelper.JSAlert(Page, "Err", status + "失败"); return; } iac.Status = status; if (status == "正常") { int i = Convert.ToInt32(iac.Quantity); i++; iac.Quantity = i; } biac.Update(iac); Common.JShelper.JSAlertAndRedirect(Page, "Err", status + "成功", "lowconformlist.aspx"); } else { Common.JShelper.JSAlert(Page, "Err", status + "失败"); return; } }
protected void Submit(string status) { Model.GoodsMaintain mgoods = new LabMS.Model.GoodsMaintain(); BLL.GoodsMaintain bgoods = new LabMS.BLL.GoodsMaintain(); mgoods = bgoods.GetModel(long.Parse(strID)); mgoods.LabName = tbLabNum.Text.Trim(); mgoods.AssetManagers = tbManager.Text.Trim(); mgoods.Tel = tbTelNum.Text.Trim(); mgoods.Numbers = tbLowNum.Text.Trim(); mgoods.Name = tbLowname.Text.Trim(); mgoods.StorageSites = tbStoreAdd.Text.Trim(); mgoods.Applicant = tbApplyer.Text.Trim(); mgoods.Guarantee = isInTime.SelectedValue; DateTime tempTime = new DateTime(); if (DateTime.TryParse(tbReportTime.Text.Trim(), out tempTime)) { mgoods.ReportedTime = tempTime; } mgoods.Describe = tbDescription.Text.Trim(); mgoods.Status = status; mgoods.MCo = tbRepairGroup.Text.Trim(); mgoods.MLinkman = tbTransfer.Text.Trim(); mgoods.MPhone = tbPhoneNum.Text.Trim(); if (DateTime.TryParse(tbRepairTime.Text.Trim(), out tempTime)) { mgoods.MDate = tempTime; } mgoods.MComment = tbComments.Text.Trim(); mgoods.AcceptanceViews = tbConformComments.Text.Trim(); try { bgoods.Update(mgoods); LabMS.Common.JShelper.JSAlertAndRedirect(Page, "ModifySuccess", "操作成功!", "valuablesconformlist.aspx"); } catch (Exception ex) { Err.Text = ex.Message.ToString(); } }