Beispiel #1
0
 /// <summary>
 /// 获取体检单位详细信息
 /// </summary>
 /// <param name="usercode"></param>
 /// <returns></returns>
 public Dictuserandlab GetDictcustomeridInfo(Dictuserandlab library)
 {
     //Dictuserandlab obj = null;
     //IList lst = this.selectIList("Dict.GetDictuserandlabInfo", library);
     //if (lst.Count > 0)
     //    obj = (Dictuserandlab)lst[0];
     //return obj;
     return(this.selectObj <Dictuserandlab>("Dict.GetDictuserandlabInfo", library));
 }
Beispiel #2
0
        ///<summary>
        ///新增编辑后保存
        ///</summary>
        ///<param name="library"></param>
        /// <returns></returns>
        public bool SaveDictuserandlab(Dictuserandlab library)
        {
            int nflag = 0;

            //新增
            if (library.Dictuserandlabid == 0 || library.Dictuserandlabid == null)
            {
                try
                {
                    library.Dictuserandlabid = getSeqID("SEQ_DICTUSERANDLAB");
                    insert("Dict.InsertDictuserandlab", library);
                    nflag = 1;
                    List <LogInfo> logLst  = getLogInfo <Dictuserandlab>(new Dictuserandlab(), library);
                    Dictlab        dictlab = new Dictlab();
                    dictlab.Dictlabid = library.Dictlabid;
                    dictlab           = new DictlabService().GetDictlabInfo(dictlab);
                    AddMaintenanceLog("Dictuserandlab", int.Parse(library.Dictuserandlabid.ToString()), logLst, "新增", dictlab.Labname, library.Createdate.ToString(), modulename);
                }
                catch (Exception ex)
                {
                    nflag = 0;
                    throw new Exception(ex.Message);
                }
            }
            else//保存
            {
                try
                {
                    Dictuserandlab dictcustomer = GetDictcustomeridInfo(library);
                    nflag = update("Dict.UpdateDictuserandlab", library);
                    List <LogInfo> logLst  = getLogInfo <Dictuserandlab>(dictcustomer, library);
                    Dictlab        dictlab = new Dictlab();
                    dictlab.Dictlabid = library.Dictlabid;
                    dictlab           = new DictlabService().GetDictlabInfo(dictlab);
                    AddMaintenanceLog("Dictuserandlab", int.Parse(library.Dictuserandlabid.ToString()), logLst, "修改", dictlab.Labname, library.Createdate.ToString(), modulename);
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
            return(nflag > 0);
        }
 /// <summary>
 /// 分点添加
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         StringBuilder sb      = new StringBuilder();
         SortedList    SQLlist = new SortedList(new MySort());
         //double userId = 0;
         //if (gvList.SelectedRowIndexArray.Length > 0)
         //{
         //    object[] objValue = gvList.DataKeys[gvList.SelectedRowIndexArray[0]];
         //    userId = TypeParse.StrToDouble(objValue[0], 0);
         //}
         if (DictUserId != 0)
         {
             if (gdLabItem.SelectedRowIndexArray.Length > 0)
             {
                 var            library = new DictuserlabService();
                 Dictuserandlab userlab = new Dictuserandlab();
                 userlab.Dictuserid = DictUserId;
                 Hashtable hts = new Hashtable();
                 hts.Add("value", userlab.Dictuserid);
                 SQLlist.Add(new Hashtable()
                 {
                     { "DELETE", "Dict.DeleteDictuserandlabByUserId" }
                 }, userlab.Dictuserid);
                 foreach (int row in gdLabItem.SelectedRowIndexArray)
                 {
                     Dictuserandlab dictuserandlabList = new Dictuserandlab();
                     dictuserandlabList.Dictuserandlabid = library.getSeqID("SEQ_DICTUSERANDLAB");
                     dictuserandlabList.Dictlabid        = Convert.ToDouble(gdLabItem.DataKeys[row][0].ToString());
                     dictuserandlabList.Dictuserid       = Convert.ToInt32(DictUserId);
                     dictuserandlabList.Createdate       = DateTime.Now;
                     SQLlist.Add(new Hashtable()
                     {
                         { "INSERT", "Dict.InsertDictuserandlab" }
                     }, dictuserandlabList);
                 }
                 if (library.ExecuteSqlTran(SQLlist))
                 {
                     BindGridLabTo();
                     MessageBoxShow("所选分点已成功保存,需重新登陆数据才能生效!", MessageBoxIcon.Information);
                 }
                 else
                 {
                     MessageBoxShow("所选分点添加有误!", MessageBoxIcon.Warning);
                 }
             }
             else
             {
                 MessageBoxShow("您未选择分点!", MessageBoxIcon.Warning);
             }
         }
         else
         {
             MessageBoxShow("您还未选择用户!", MessageBoxIcon.Warning);
         }
     }
     catch (Exception ex)
     {
         MessageBoxShow(ex.Message, MessageBoxIcon.Error);
     }
 }