예제 #1
0
 protected void btnDelAll_Click(object sender, EventArgs e)
 {
     try
     {
         StringBuilder sb = new StringBuilder();
         foreach (int row in gvList.SelectedRowIndexArray)
         {
             sb.Append(gvList.DataKeys[row][0].ToString());
             dictlab.Dictlabid = Convert.ToDouble(gvList.DataKeys[row][0].ToString());
             dictlab           = dictlabService.GetDictlabInfo(dictlab);
             string pictureUrl = Server.MapPath("../../upload/" + dictlab.Labimage);
             //判断文件是否存在
             if (File.Exists(pictureUrl))
             {
                 File.Delete(pictureUrl);//删除原文件
             }
             sb.Append(",");
         }
         var library = new DictlabService();
         int nflag   = library.DelDictlabByID(sb.ToString().TrimEnd(','));
         if (nflag > 0)
         {
             MessageBoxShow("所选项已成功删除", MessageBoxIcon.Information);
             BindGrid();
             dictlabId = 0;
             LoadEditDate();
         }
         CacheHelper.RemoveAllCache("daan.GetDictlab");
     }
     catch (Exception ex)
     {
         MessageBoxShow(ex.Message);
     }
 }
예제 #2
0
        public AuthenticateResponse Process(AuthenticateRequest request)
        {
            var userInfo = new UserInfo();

            var initlocalsettingRepo = RepositoryManager.GetRepository <IInitlocalsettingRepository>();
            var initlocalsetting     = initlocalsettingRepo.GetByKey(request.HostMac);

            if (initlocalsetting != null)
            {
                userInfo.UserPrinterConfig = new UserPrinterConfig()
                {
                    A4Printer      = initlocalsetting.A4printer,
                    A5Printer      = initlocalsetting.A5printer,
                    BarcodePrinter = initlocalsetting.Barcodeprinter,
                    PdfPrinter     = initlocalsetting.Pdfprinter
                };
            }

            var userRepo = RepositoryManager.GetRepository <IDictUserRepository>();
            var dictUser = userRepo.GetByUserCode(request.Username);

            if (dictUser != null && dictUser.Dictlabid.HasValue)
            {
                var dictLabInfo = new DictlabService().GetDictlabById(dictUser.Dictlabid.Value);
                if (dictLabInfo != null)
                {
                    userInfo.DefaultLab = dictLabInfo.ToLabInfo();
                }
            }

            return(new AuthenticateResponse()
            {
                ResultType = ResultTypes.Ok, UserInfo = userInfo
            });
        }
예제 #3
0
        /// <summary>
        /// 查询条件
        /// </summary>
        /// <returns></returns>
        private Hashtable getPara()
        {
            Hashtable ht = new Hashtable();

            ht.Add("DateStart", dateStart.Text == "" ? null : Convert.ToDateTime(dateStart.Text).ToString("yyyy-MM-dd"));
            ht.Add("DateEnd", dateEnd.Text == "" ? null : Convert.ToDateTime(dateEnd.Text).AddDays(1).ToString("yyyy-MM-dd"));
            if (comLab.SelectedIndex == 0)
            {
                List <Dictlab> list      = new DictlabService().GetDictlabList();
                StringBuilder  joinlabid = new StringBuilder();
                foreach (Dictlab lab in list)
                {
                    joinlabid.Append(lab.Dictlabid + ",");
                }
                ht.Add("labid", joinlabid.ToString().TrimEnd(','));
            }
            else
            {
                ht.Add("labid", comLab.SelectedValue);
            }
            if (comCustomer.SelectedIndex == 0)
            {
                ht.Add("dictcustomerid", "-1");
            }
            else
            {
                ht.Add("dictcustomerid", comCustomer.SelectedValue);
            }
            ht.Add("pageStart", 1);
            ht.Add("pageEnd", 20);
            ht.Add("Section", txtSection.Text.Trim());
            return(ht);
        }
예제 #4
0
        private void BindDrop()
        {
            try
            {
                List <Dictlab> dictlab = new DictlabService().GetDictlabList();
                this.Drop_Dictlab.DataSource     = dictlab;
                this.Drop_Dictlab.DataTextField  = "Labname";
                this.Drop_Dictlab.DataValueField = "Dictlabid";
                this.Drop_Dictlab.DataBind();
                this.Drop_Dictlab.Items.Insert(0, new ExtAspNet.ListItem("请选择", "-1"));

                this.Drop_DictLabDepTid.DataSource     = new LoginService().GetLoginDictlabdeptList();
                this.Drop_DictLabDepTid.DataTextField  = "Labdeptname";
                this.Drop_DictLabDepTid.DataValueField = "Dictlabdeptid";
                this.Drop_DictLabDepTid.DataBind();
                Drop_DictLabDepTid.Items.Insert(0, new ExtAspNet.ListItem("请选择", "-1"));

                dictuser.Dictuserid = DictUserId;
                Dictuser user = new DictuserService().GetDictuserInfo(dictuser);
                this.Drop_Dictlab.SelectedValue       = user.Dictlabid.ToString();
                this.Drop_DictLabDepTid.SelectedValue = user.Dictlabdeptid.ToString();
                this.radlIsactive.SelectedValue       = user.Active;
            }
            catch (Exception ex)
            {
                MessageBoxShow(ex.Message, MessageBoxIcon.Error);
            }
        }
예제 #5
0
        /// <summary>
        /// 绑定分点
        /// </summary>
        private void BindDrop()
        {
            List <Dictlab> dictlab = new DictlabService().GetDictlabList();

            this.DropDictLab.DataSource     = dictlab;
            this.DropDictLab.DataTextField  = "Labname";
            this.DropDictLab.DataValueField = "Dictlabid";
            this.DropDictLab.DataBind();
        }
예제 #6
0
        /// <summary>
        /// 查询条件
        /// </summary>
        /// <returns></returns>
        private Hashtable getPara()
        {
            Hashtable ht = new Hashtable();

            ht.Add("StartDate", dateStart.Text == "" ? null : Convert.ToDateTime(dateStart.Text).ToString("yyyy-MM-dd"));
            ht.Add("EndDate", dateEnd.Text == "" ? null : Convert.ToDateTime(dateEnd.Text).AddDays(1).ToString("yyyy-MM-dd"));
            if (comLab.SelectedIndex == 0)
            {
                List <Dictlab> list      = new DictlabService().GetDictlabList();
                StringBuilder  joinlabid = new StringBuilder();
                foreach (Dictlab lab in list)
                {
                    joinlabid.Append(lab.Dictlabid + ",");
                }
                ht.Add("labid", joinlabid.ToString().TrimEnd(','));
            }
            else if (comLab.SelectedIndex == 1)
            {
                ht.Add("labid", comLab.SelectedValue);
            }
            else
            {
                ht.Add("labid", "43,44,45,46,47,2,3");
            }
            if (comCustomer.SelectedIndex == 0)
            {
                ht.Add("dictcustomerid", null);
            }
            else
            {
                ht.Add("dictcustomerid", comCustomer.SelectedValue);
            }
            ht.Add("Section", txtSection.Text.Trim());
            if (radAll.Checked)
            {
                ht.Add("reporttype", null);
            }
            if (radC14.Checked)
            {
                ht.Add("reporttype", "61");
            }
            if (radTM.Checked)
            {
                ht.Add("reporttype", "3");
            }
            //是否过滤已打印报告
            if (ckPrinted.Checked)
            {
                ht.Add("printed", "25");
            }
            //是否过滤现场报告
            if (ckXianChang.Checked)
            {
                ht.Add("xianchang", "1");
            }
            return(ht);
        }
예제 #7
0
 /// <summary>
 /// 获取分点字典
 /// </summary>
 public List <Dictlab> GetLoginDictlab()
 {
     if (CacheHelper.GetCache("daan.GetDictlab") != null)
     {
         return((List <Dictlab>)CacheHelper.GetCache("daan.GetDictlab"));
     }
     else
     {
         List <Dictlab> ds = new DictlabService().GetDictlabList();
         return(ds);
     }
 }
예제 #8
0
        private void BindDrop()
        {
            DictlabService        dictlabService = new DictlabService();
            IEnumerator <Dictlab> enumerator     = dictlabService.GetDictlabList().GetEnumerator();

            ddldictlab.Items.Add(new ExtAspNet.ListItem("请选择", "-1"));

            while (enumerator.MoveNext())
            {
                ddldictlab.Items.Add(new ExtAspNet.ListItem(enumerator.Current.Labname, enumerator.Current.Dictlabid.ToString()));
            }
        }
예제 #9
0
        /// <summary>
        /// 绑定分点列表
        /// </summary>
        private void BindGridLabTo() //分点列表
        {
            try
            {
                //分页查询条件
                PageUtil  pageUtil = new PageUtil(gdLabItem.PageIndex, gdLabItem.PageSize);
                Hashtable ht1      = new Hashtable();
                //ht1.Add("Userid", DictUserId);
                ht1.Add("pageStart", pageUtil.GetPageStartNum()); //pageUtil.GetPageStartNum()
                ht1.Add("pageEnd", pageUtil.GetPageEndNum());     // pageUtil.GetPageEndNum()
                //设置总项数
                gdLabItem.RecordCount = new DictlabService().GetDictlabPageLstCount(ht1);
                gdLabItem.DataSource  = new DictlabService().GetDictlabPageLst(ht1);

                List <Dictlabdept> dictlabdep = new DictlabdeptService().GetDictlabdeptPageLstUser(ht1).ToList();
                //double userId = 0;
                //if (gvList.SelectedRowIndexArray.Length > 0)
                //{
                //    object[] objValue = gvList.DataKeys[gvList.SelectedRowIndexArray[0]];
                //    userId = TypeParse.StrToDouble(objValue[0], 0);
                //}

                //全部列表
                List <Dictlab> labLst = new DictlabService().GetDictlabPageLst(ht1).ToList <Dictlab>();
                Hashtable      ht2    = new Hashtable();
                ht2.Add("Userid", DictUserId);
                ht2.Add("pageStart", pageUtil.GetPageStartNum());
                ht2.Add("pageEnd", pageUtil.GetPageEndNum());
                IList <Dictuserandlab> dictlabList = new DictuserlabService().GetDictuserandlabPageLst(ht2);
                gdLabItem.DataBind();
                int[] labArray = new int[dictlabList.Count];
                if (dictlabList.Count != 0)
                {
                    int index = 0;
                    foreach (Dictuserandlab item in dictlabList)
                    {
                        labArray[index] = labLst.IndexOf(labLst.Find(lab => lab.Dictlabid == item.Dictlabid));
                        index++;
                    }
                    gdLabItem.SelectedRowIndexArray = labArray;
                }
                else
                {
                    gdLabItem.SelectedRowIndexArray = new int[] { };
                }
            }
            catch (Exception ex)
            {
                MessageBoxShow(ex.Message, MessageBoxIcon.Error);
            }
        }
예제 #10
0
 /// <summary>
 /// 绑定分点下拉框
 /// </summary>
 private void BindDrop()
 {
     try
     {
         List <Dictlab> dictlab = new DictlabService().GetDictlabList();
         this.DropDictLab.DataSource     = dictlab;
         this.DropDictLab.DataTextField  = "Labname";
         this.DropDictLab.DataValueField = "Dictlabid";
         this.DropDictLab.DataBind();
         //this.DropDictLab.Items.Insert(0, new ExtAspNet.ListItem("请选择", "-1"));
     }
     catch (Exception ex)
     {
         MessageBoxShow(ex.Message, MessageBoxIcon.Error);
     }
 }
예제 #11
0
        /// <summary>
        /// 扫描HPV样本条码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void tbxbarcode_TriggerClick(object sender, EventArgs e)
        {
            if (this.tbxbarcode.Text.Trim() == "")
            {
                MessageBoxShow("标本条码为空!"); clearList(); return;
            }
            Hashtable ht1 = new Hashtable();

            ht1.Add("Barcode", tbxbarcode.Text);
            List <Hpvinstruments> hpvinstrmentsList = hpvService.GetHpvinstrumentsByWhere(ht1).ToList();

            if (hpvinstrmentsList.Count == 0)
            {
                this.tbxbarcode.Text = string.Empty; MessageBoxShow("没有找到该标本条码"); clearList(); return;
            }
            //单位
            Dictcustomer dictcustomer = dictCustomerService.GetDictCustomerById(Convert.ToDouble(hpvinstrmentsList[0].Dictcustomerid));

            if (dictcustomer != null)
            {
                //分点
                Dictlab dictlab = new DictlabService().GetDictlabById(Convert.ToDouble(dictcustomer.Dictlabid));
                if (dictlab != null)
                {
                    this.DropDictLab.SelectedValue = dictlab.Dictlabid.ToString();
                    if (DropDictLab.SelectedValue != null)
                    {
                        BindCustomer(Convert.ToInt32(DropDictLab.SelectedValue));
                        this.DropCustomer.SelectedValue = hpvinstrmentsList[0].Dictcustomerid.ToString();
                        BindDictTest(DropDictLab.SelectedValue);
                    }
                }
            }
            ViewState["SendCustomer"] = null;
            BindDictProduct(DropCustomer.SelectedValue);
            string productname = "";
            List <OrderRegister> _gridtestList = GetGridTest(false);
            string msg = registerserver.AddProduct(ref _gridtestList, DropSex.SelectedValue, Convert.ToDouble(hpvinstrmentsList[0].Dicttestitemid), false, Userinfo, ref productname, tbxbarcode.Text);

            if (msg != string.Empty)
            {
                MessageBoxShow(msg); return;
            }
            tbxItemTest.Text += productname + ",";
            BindGridTest(_gridtestList);
            this.tbxbarcode.Text = string.Empty;
        }
예제 #12
0
        /// <summary>初始化信息
        ///
        /// </summary>
        private void LoadData()
        {
            try
            {
                //绑定财务人员
                this.dropDictcheckBillId.DataSource     = new DictuserService().GetDictuser();
                this.dropDictcheckBillId.DataTextField  = "Username";
                this.dropDictcheckBillId.DataValueField = "Dictuserid";
                this.dropDictcheckBillId.DataBind();

                //绑定销售人员
                this.dropDictsalemanId.DataSource     = new DictuserService().GetDictuser();
                this.dropDictsalemanId.DataTextField  = "Username";
                this.dropDictsalemanId.DataValueField = "Dictuserid";
                this.dropDictsalemanId.DataBind();


                //绑定分点
                List <Dictlab> lisSource = new DictlabService().GetDictlabList();
                this.dropDictLab.DataSource     = lisSource;
                this.dropDictLab.DataTextField  = "Labname";
                this.dropDictLab.DataValueField = "Dictlabid";
                this.dropDictLab.DataBind();

                //绑定查询分点
                this.dropLabSearch.DataSource     = lisSource;
                this.dropLabSearch.DataTextField  = "Labname";
                this.dropLabSearch.DataValueField = "Dictlabid";
                this.dropLabSearch.DataBind();
                this.dropLabSearch.Items.Insert(0, new ExtAspNet.ListItem("全部", "-1"));
            }
            catch (Exception ex)
            {
                MessageBoxShow(ex.Message, MessageBoxIcon.Error);
            }
        }
예제 #13
0
        //保存数据的逻辑
        public bool SaveDictlibrary()
        {
            try
            {
                string fileName = "";
                #region //上传大图
                if (this.FileUp.HasFile)
                {
                    fileName = new FileInfo(FileUp.FileName).Name;                         //文件名称
                    string type = fileName.Substring(fileName.IndexOf(".") + 1).ToLower(); //文件的格式
                    //判断文件格式
                    if (type != ("jpg") && type != ("gif") && type != ("png") && type != ("jpeg") && type != ("bmp"))
                    {
                        errorType = "上传图片格式不正确!";
                        return(false);
                    }
                    if (dictlab.Dictlabid == 0)
                    {
                        fileName = UploadPhoto(this.FileUp);//上传文件
                    }
                    else
                    {
                        dictlab = dictlabService.GetDictlabInfo(dictlab);
                        string pictureUrl = Server.MapPath("../../upload/" + dictlab.Labimage);
                        fileName = UploadPhoto(this.FileUp);//上传文件
                        //判断文件是否存在
                        if (File.Exists(pictureUrl))
                        {
                            File.Delete(pictureUrl); //删除原文件
                        }
                        dictlab.Labimage = fileName; //修改新的文件名
                    }
                }
                #endregion
                if (this.tbxADDRES.Text.Trim() != "")
                {
                    dictlab.Addres = this.tbxADDRES.Text.Trim();
                }
                else
                {
                    errorType = "地址不能为空!";
                    return(false);
                }
                if (this.dropShi.SelectedValue != "-1")
                {
                    dictlab.City = this.dropSheng.SelectedValue + "," + this.dropShi.SelectedValue;
                }
                else
                {
                    errorType = "下拉框数据出错!";
                    return(false);
                }
                dictlab.Contactman   = this.tbxCONTACTMAN.Text.Trim();
                dictlab.Displayorder = Convert.ToInt32(this.tbxDISPLAYORDER.Text.Trim() == "" ? 0 : Convert.ToInt32(this.tbxDISPLAYORDER.Text.Trim()));
                if (this.tbxLABNAME.Text.Trim() != "")
                {
                    dictlab.Labname = this.tbxLABNAME.Text.Trim();
                }
                else
                {
                    errorType = "分点名称不能为空!";
                    return(false);
                }
                if (this.tbxPHONE.Text.Trim() != "")
                {
                    dictlab.Phone = this.tbxPHONE.Text.Trim();
                }
                else
                {
                    errorType = "联系电话不能为空!";
                    return(false);
                }
                dictlab.Zpcode         = this.tbxZPCODE.Text.Trim();
                dictlab.Labdescription = this.Txa.Text.Trim();
                dictlab.Website        = this.tbxWebSite.Text.Trim();
                if (this.tbxLabCode.Text.Trim() != "")
                {
                    dictlab.Labcode = this.tbxLabCode.Text.Trim();
                }
                else
                {
                    errorType = "分点简称不能为空!";
                    return(false);
                }

                dictlab.Esitename = this.tbxEsiteName.Text.Trim();
                dictlab.Fax       = this.tbxFax.Text.Trim();
                if (dictlab.Dictlabid == 0)
                {
                    if (FileUp.FileName != "")
                    {
                        dictlab.Labimage = "labUploadFiles/" + fileName;
                    }
                    else
                    {
                        errorType = "请上传图片!";
                        return(false);
                    }
                }
                else
                {
                    if (FileUp.FileName != "")
                    {
                        dictlab.Labimage = "labUploadFiles/" + fileName;
                    }
                    else
                    {
                        Dictlab di = new DictlabService().GetDictlabInfo(dictlab);
                        dictlab.Labimage = di.Labimage;
                    }
                }
                return(dictlabService.SaveDictlab(dictlab));
            }
            catch (Exception ex)
            {
                MessageBoxShow(ex.Message);
                return(false);
            }
        }
예제 #14
0
        private void LoadEditDate()
        {
            dictlab.Dictlabid = dictlabId;
            Dictlab dictlabfo = new DictlabService().GetDictlabInfo(dictlab);

            BindSheng();
            BindShi();
            if (dictlabfo == null)
            {
                dictlab = new Dictlab();
                SimpleFormEdit.Title      = "当前状态-新增";
                this.tbxADDRES.Text       = dictlab.Addres;
                this.tbxCONTACTMAN.Text   = dictlab.Contactman;
                this.tbxDISPLAYORDER.Text = dictlab.Displayorder.ToString();
                this.tbxLABNAME.Text      = dictlab.Labname;
                this.tbxPHONE.Text        = dictlab.Phone;
                this.tbxZPCODE.Text       = dictlab.Zpcode;
                if (dictlab.City != null)
                {
                    string type = dictlab.City.Substring(0, dictlab.City.LastIndexOf(","));
                    dropSheng.SelectedValue = type;
                    dropSheng_SelectedIndexChanged(Page, EventArgs.Empty);
                    string shiType = dictlab.City.Substring(dictlab.City.IndexOf(",") + 1);
                    dropShi.SelectedValue = shiType;
                }
                else
                {
                    this.dropSheng.SelectedItem.Value = "-1";
                    dropSheng_SelectedIndexChanged(Page, EventArgs.Empty);
                    this.dropShi.SelectedValue = "";
                }
                this.imgA.Visible = true;
                if (dictlab.Labimage != null)
                {
                    this.imgA.ImageUrl = "../../upload/" + dictlab.Labimage;
                }
                else
                {
                    this.imgA.ImageUrl = "../../images/NoPictures.jpg";
                }
                this.tbxFax.Text       = dictlab.Fax;
                this.tbxEsiteName.Text = dictlab.Esitename;
                this.tbxLabCode.Text   = dictlab.Labcode;
                this.tbxWebSite.Text   = dictlab.Website;
                this.Txa.Text          = dictlab.Labdescription;
            }
            else
            {
                this.tbxADDRES.Text       = dictlabfo.Addres;
                this.tbxCONTACTMAN.Text   = dictlabfo.Contactman;
                this.tbxDISPLAYORDER.Text = dictlabfo.Displayorder.ToString();
                this.tbxLABNAME.Text      = dictlabfo.Labname;
                this.tbxPHONE.Text        = dictlabfo.Phone;
                this.tbxZPCODE.Text       = dictlabfo.Zpcode;
                if (dictlabfo.City != null)
                {
                    string type = dictlabfo.City.Substring(0, dictlabfo.City.LastIndexOf(","));
                    dropSheng.SelectedValue = type;
                    dropSheng_SelectedIndexChanged(Page, EventArgs.Empty);
                    string shiType = dictlabfo.City.Substring(dictlabfo.City.IndexOf(",") + 1);
                    dropShi.SelectedValue = shiType;
                }
                else
                {
                    this.dropSheng.SelectedValue = "-1";
                    dropSheng_SelectedIndexChanged(Page, EventArgs.Empty);
                    this.dropShi.SelectedValue = "";
                }
                this.imgA.Visible = true;
                if (dictlabfo.Labimage != null)
                {
                    this.imgA.ImageUrl = "../../upload/" + dictlabfo.Labimage;
                }
                else
                {
                    this.imgA.ImageUrl = "../../images/NoPictures.jpg";
                }
                //if (dictlab.Labimage == null)
                //{
                //    this.FileUp. = "";
                //}
                //this.FileUp.Text = dictlab.Labimage;
                this.tbxFax.Text       = dictlabfo.Fax;
                this.tbxEsiteName.Text = dictlabfo.Esitename;
                this.tbxLabCode.Text   = dictlabfo.Labcode;
                this.tbxWebSite.Text   = dictlabfo.Website;
                this.Txa.Text          = dictlabfo.Labdescription;
            }
        }