Exemple #1
0
        public void ProcessRequest(HttpContext context)
        {
            if (context.Request != null&&context.Request["Code"]!=null)
            {
                string strCode = context.Request["Code"].ToString();
                LabMS.BLL.InstrumentAndConsumables binstrument
                    = new LabMS.BLL.InstrumentAndConsumables();
                List<LabMS.Model.InstrumentAndConsumables> listInstrument
                    = new List<LabMS.Model.InstrumentAndConsumables>();
                ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary();
                List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>();

                listInstrument = binstrument.GetModelList("Numbers = '" + strCode+"'");
                if (listInstrument.Count < 0)
                {
                    return;
                }

                listCClass = eDictionary.GetModelList("Code='" + listInstrument[0].Status + "'");
                if (listCClass.Count < 0)
                {
                    return;
                }

                context.Response.ContentType = "application/json";
                context.Response.Write("{result: '" +listCClass[0].Name+ "'}");

            }
        }
 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");
 }
        public void bind(string strCode, string strLocation, string strCondition)
        {
            LabMS.BLL.InstrumentAndConsumables bconsum = new LabMS.BLL.InstrumentAndConsumables();
            if (strCondition.Trim().Equals(""))
            {
                strCondition = "";
            }
            else
            {
                strCondition = " and " + strCondition;
            }
            string strWhere = " Type = '" + strCode + "'and SpaceLocation= '" + strLocation + "' and Quantity>0 " + strCondition + " order by ID desc ";
            if (strLocation.Equals("@ALL@"))
            {
                strWhere = " Type = '" + strCode + "'and  Quantity>0 " + strCondition + " order by ID desc ";
            }

            List<LabMS.Model.InstrumentAndConsumables> listmconsum = bconsum.GetModelList(strWhere);
            GridView1.DataSource = listmconsum;
            GridView1.DataBind();
        }
Exemple #4
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;
            }
        }
Exemple #5
0
        void bind(LabMS.Model.RecipientsApp recipientsApp)
        {
            Comment.Text = Common.codehelper.Decode(recipientsApp.AppComment);

            tbUserNub.Text = recipientsApp.AppNub;
            tbCNub.Text = recipientsApp.ClassNumber;
            List<LabMS.Model.InstrumentAndConsumables> mconsum = new List<LabMS.Model.InstrumentAndConsumables>();
            LabMS.BLL.InstrumentAndConsumables bconsum = new LabMS.BLL.InstrumentAndConsumables();

            mconsum = bconsum.GetModelList("Numbers='" + recipientsApp.ClassNumber + "'");
            if (mconsum.Count == 0)
            {
                Common.JShelper.JSAlert(Page, "err", "数据错误,请删除此条记录!");
                return;
            }
            try
            {
                lbAllNub.Text = mconsum[0].Quantity.Value.ToString();
            }
            catch
            {
            }
            LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>();
            mLab = blab.GetModelList("Lab_Code='" + recipientsApp.Laboratory + "'");
            if (mLab.Count > 0)
            {
                tbLabName.Text = mLab[0].Lab_Name;
            }
            tbLabCode.Value = recipientsApp.Laboratory;

            lbCName.Text = recipientsApp.Name;
            try
            {
                tbRecipientsDate.Text = recipientsApp.RecipientTime.Value.ToShortDateString();
            }
            catch { }

            lbTypeNub.Text = recipientsApp.Words;
        }
        protected void btnApp_Click(object sender, EventArgs e)
        {
            lbErr.Visible = false;
            Button btn = (Button)sender;
            string strAudit = "";
            string strAlert = "";
            if (btn.ID == "btnCancelApp")
            {
                strAudit = "0";
                strAlert = "撤销申请成功!";
            }
            if (btn.ID == "btnApp")
            {
                strAudit = "1";
                strAlert = "申请成功,请等待审核!";
            }
            if (btn.ID == "tbnCheck")
            {
                strAudit = "3";
                strAlert = "审核成功!";

                LabMS.BLL.RecipientsApp brapp = new LabMS.BLL.RecipientsApp();
                LabMS.Model.RecipientsApp mrecipeintsapp = new LabMS.Model.RecipientsApp();
                try
                {
                    mrecipeintsapp = brapp.GetModel(long.Parse(tbID.Text));
                }
                catch (Exception ex)
                {
                    lbErr.Text = ex.Message;
                    lbErr.Visible = true;
                    return;
                }
                if (mrecipeintsapp == null)
                {
                    Common.JShelper.JSAlert(Page, "err","数据错误,请删除此条记录!");
                    return;
                }
                List<LabMS.Model.InstrumentAndConsumables> mconsum = new List<LabMS.Model.InstrumentAndConsumables>();
                LabMS.BLL.InstrumentAndConsumables bconsum = new LabMS.BLL.InstrumentAndConsumables();

                mconsum = bconsum.GetModelList("Numbers='" + mrecipeintsapp.ClassNumber + "'");
                if (mconsum.Count == 0)
                {
                    Common.JShelper.JSAlert(Page, "err", "数据错误,请删除此条记录!");
                    return;
                }
                decimal iQuantityRecipients = 0;
                decimal.TryParse(mrecipeintsapp.AppNub, out iQuantityRecipients);
                if (iQuantityRecipients > mconsum[0].Quantity)
                {
                    Common.JShelper.JSAlert(Page, "err", "库存不足!");
                    return;
                }
                else
                {
                    if (mrecipeintsapp.Type == "xiaohaopin")
                    {
                        LabMS.Model.SuppliesRecipients model = new LabMS.Model.SuppliesRecipients();
                        model.Arrow = mrecipeintsapp.Arrow;
                        model.Comment = "通过申请借出!";
                        model.EncodedTime = mrecipeintsapp.RecipientTime;
                        model.EncodedWarehouse = mrecipeintsapp.EncodedWarehouse;
                        model.Laboratory = mrecipeintsapp.Laboratory;
                        model.Name = mrecipeintsapp.Name;
                        model.Numbers = mrecipeintsapp.ClassNumber;
                        model.OperatDate = DateTime.Today;
                        model.Operator = "sys";//用户
                        model.QuantityRecipients = mrecipeintsapp.AppNub;
                        model.Recipients = mrecipeintsapp.MRecipients;
                        model.Words = mrecipeintsapp.Words;

                        ExtendBLL.SuppliesRecipients EbSRecipient = new ExtendBLL.SuppliesRecipients();
                        try
                        {
                            EbSRecipient.ExtendAdd(model, (decimal)mconsum[0].Quantity);
                        }
                        catch (Exception ex)
                        {
                            lbErr.Visible = true;
                            lbErr.Text = ex.Message.ToString();
                            return;
                        }
                    }
                    else
                    {
                        ExtendBLL.Recipients brecipients = new ExtendBLL.Recipients();
                        Model.Recipients recipients = new LabMS.Model.Recipients();
                        recipients.BorrowedState = "良好";
                        recipients.Comment = "通过申请借出!";
                        recipients.EncodedTime = mrecipeintsapp.RecipientTime;
                        recipients.MRecipients = mrecipeintsapp.MRecipients;
                        recipients.Name = mrecipeintsapp.Name;
                        recipients.Numbers = mrecipeintsapp.ClassNumber;
                        recipients.OperatDate = DateTime.Today;
                        recipients.Operator = "";
                        recipients.Type = mrecipeintsapp.Type;

                        try
                        {
                            brecipients.ExtendAdd(recipients);
                        }
                        catch (Exception ex)
                        {
                            lbErr.Visible = true;
                            lbErr.Text = ex.Message.ToString();
                            return;
                        }
                    }
                }
            }
            if (btn.ID == "tbnUnChek")
            {
                strAudit = "2";
                strAlert = "审核成功!";
            }
            ExtendBLL.RecipientsApp extendrapp = new ExtendBLL.RecipientsApp();
            string strID = tbID.Text;
            try
            {
                if (btn.ID == "btnApp" || btn.ID == "btnCancelApp")
                {
                    extendrapp.UpdateStatus(strAudit, strID);
                }
                else
                {
                    string strChecker = UserRealName;//用户名
                    string strCheckContent = VerifyComment.Text.Trim();
                    extendrapp.SetCheck(strAudit, strID, DateTime.Today.ToShortDateString(), strChecker, strCheckContent);
                }
            }
            catch (Exception ex)
            {
                lbErr.Text = ex.Message;
                lbErr.Visible = true;
                return;
            }
            if (tbEType.Text != "")
            {
                Common.JShelper.JSAlertAndRedirect(Page, "success", strAlert, "recipientappperview.aspx?ID=" + tbID.Text + "&Type=" + tbEType.Text);
            }
            else
            {
                Common.JShelper.JSAlertAndRedirect(Page, "success", strAlert, "recipientappperview.aspx?ID=" + tbID.Text);
            }
        }