예제 #1
0
        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;
            }
        }
예제 #2
0
        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();
            }
        }