/// <summary>
        /// 修改
        /// </summary>
        private void updateDictionary()
        {
            try
            {
                SysDictionary Dictionary = new SysDictionary();

                Dictionary.D_Code = D_Code.Text;
                Dictionary.D_Name = D_Name.Text;
                Dictionary.D_Type = D_Type.SelectedItem.ToString();
                Dictionary.D_Seq  = int.Parse(D_Seq.Value.ToString());


                Dictionary.D_CreateBy   = D_CreateBy.Text;
                Dictionary.D_CreateDate = D_CreateDate.Value;

                Dictionary.D_UpdateBy   = D_UpdateBy.Text;
                Dictionary.D_UpdateDate = D_UpdateDate.Value;

                SysDictionaryBLL Dictionarybll = new SysDictionaryBLL();
                if (Dictionarybll.Edit(Dictionary) > 0)
                {
                    untCommon.InfoMsg("修改成功!");
                    frmParent.loadData();
                }
                else
                {
                    untCommon.InfoMsg("修改失败!");
                }
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("常规信息管理更新数据异常:" + ex.Message);
            }
        }
        private void deleteDictionary()
        {
            try
            {
                if (dataGridView.SelectedRows.Count < 1)
                {
                    return;
                }

                string D_Code = dataGridView.SelectedRows[0].Cells["D_Code"].Value.ToString();

                if (untCommon.QuestionMsg("您确定删除[" + D_Code + "]该项吗?"))
                {
                    SysDictionaryBLL companybll = new SysDictionaryBLL();
                    if (companybll.Delete(D_Code) > 0)
                    {
                        untCommon.InfoMsg("删除成功!");
                        loadData();
                    }
                    else
                    {
                        untCommon.InfoMsg("删除失败!");
                    }
                }
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("常规信息管理删除数据异常:" + ex);
            }
        }
        /// <summary>
        /// 添加
        /// </summary>
        private void addDictionary()
        {
            try
            {
                if (checkInput())
                {
                    SysDictionary Dictionary = new SysDictionary();

                    Dictionary.D_Code = D_Code.Text;
                    Dictionary.D_Name = D_Name.Text;
                    Dictionary.D_Type = D_Type.SelectedItem.ToString();
                    Dictionary.D_Seq  = int.Parse(D_Seq.Value.ToString());

                    Dictionary.D_CreateBy   = D_CreateBy.Text;
                    Dictionary.D_CreateDate = D_CreateDate.Value;
                    Dictionary.D_UpdateBy   = null;
                    Dictionary.D_UpdateDate = null;

                    SysDictionaryBLL Dictionarybll = new SysDictionaryBLL();
                    if (Dictionarybll.Exists(Dictionary.D_Code))
                    {
                        untCommon.InfoMsg("信息编码已存在!");
                    }
                    else
                    {
                        if (Dictionarybll.Add(Dictionary) > 0)
                        {
                            untCommon.InfoMsg("添加成功!");
                            frmParent.loadData();
                        }
                        else
                        {
                            untCommon.InfoMsg("添加失败!");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("常规信息管理添加数据异常:" + ex.Message);
            }
        }
        public void loadData(string type = "", string key = "")
        {
            try
            {
                SysDictionaryBLL companybll = new SysDictionaryBLL();
                var rows = companybll.loadData(type, key);

                if (rows == null || rows.Count < 1)
                {
                    untCommon.InfoMsg("没有任何数据!");
                    return;
                }

                dataGridView.DataSource = rows;
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("常规信息管理加载数据异常:" + ex.Message);
            }
        }
        private string FormatTextBySysDic(string strColValue, string strSysCategory)
        {
            string  strTemp = string.Empty;
            decimal dValue  = 0;

            decimal.TryParse(strColValue, out dValue);
            List <T_SYS_DICTIONARY> entDics = new List <T_SYS_DICTIONARY>();// permClient.GetSysDictionaryByCategory(strSysCategory);

            using (SysDictionaryBLL bll = new SysDictionaryBLL())
            {
                //GetSysLeftMenuFilterPermissionToNewFrame("85b414ab-87b3-4740-aef4-1d89f3f380cc");
                entDics = bll.GetSysDictionaryByCategory(strSysCategory).ToList();
            }


            strTemp = entDics.Where(c => c.DICTIONARYVALUE == dValue).First().DICTIONARYNAME;

            strTemp = string.IsNullOrEmpty(strTemp) == true ? "-" : strTemp;
            return(strTemp);
        }
        private void getDetail()
        {
            try
            {
                SysDictionaryBLL Dictionarybll = new SysDictionaryBLL();
                SysDictionary    Dictionary    = Dictionarybll.getDetail(PrimaryKey);

                D_Code.Text         = Dictionary.D_Code;
                D_Name.Text         = Dictionary.D_Name;
                D_Type.SelectedItem = Dictionary.D_Type;
                D_Seq.Value         = Dictionary.D_Seq;


                D_CreateBy.Text = Dictionary.D_CreateBy;
                D_UpdateBy.Text = Dictionary.D_UpdateBy;

                if (Dictionary.D_CreateDate.HasValue)
                {
                    D_CreateDate.Value = Dictionary.D_CreateDate.Value;
                }
                else
                {
                    D_CreateDate.Value = DateTime.Now;
                }

                if (Dictionary.D_UpdateDate.HasValue)
                {
                    D_UpdateDate.Value = Dictionary.D_UpdateDate.Value;
                }
                else
                {
                    D_UpdateDate.Value = DateTime.Now;
                    ;
                }
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("信息管理加载数据异常:" + ex.Message);
            }
        }
 public void SysDictionaryDelete(string[] IDs)
 {
     using (SysDictionaryBLL bll = new SysDictionaryBLL())
     {
         bll.SysDictionaryDelete(IDs);
     }
 }
        public void SysDictionaryUpdate(T_SYS_DICTIONARY dict, ref string strMsg)
        {
            using (SysDictionaryBLL bll = new SysDictionaryBLL())
            {

                bll.SysDictionaryUpdate(dict, ref strMsg);
            }
        }
 public List<T_SYS_DICTIONARY> GetSysDictionaryByCategoryList(List<string> category)
 {
     using (SysDictionaryBLL bll = new SysDictionaryBLL())
     {
         List<T_SYS_DICTIONARY> dictlist = bll.GetSysDictionaryByCategory(category);
         return dictlist;
     }
 }
Beispiel #10
0
 public List<V_Dictionary> GetSysDictionaryByCategoryByUpdateDate(string category, DateTime dt)
 {
     using (SysDictionaryBLL bll = new SysDictionaryBLL())
     {
         IQueryable<V_Dictionary> dictlist = bll.GetSysDictionaryByCategoryByUpdateDate(category, dt);
         if (dictlist != null)
         {
             return dictlist.Count() > 0 ? dictlist.ToList() : null;
         }
         else
         {
             return null;
         }
     }
 }
Beispiel #11
0
        public List<T_SYS_DICTIONARY> GetSysDictionaryByFilterPaging(int pageIndex, int pageSize, string sort, string filterString, IList<object> paras, ref int pageCount, string userID)
        {
            using (SysDictionaryBLL bll = new SysDictionaryBLL())
            {
                IQueryable<T_SYS_DICTIONARY> menuList = bll.GetSysDictionaryByFilterWithPaging(pageIndex, pageSize, sort, filterString, paras, ref  pageCount, userID);

                if (menuList != null)
                {
                    return menuList.Count() > 0 ? menuList.ToList() : null;
                }
                else
                {
                    return null;
                }
            }


        }
Beispiel #12
0
 public T_SYS_DICTIONARY GetSysDictionaryByID(string dictID)
 {
     using (SysDictionaryBLL bll = new SysDictionaryBLL())
     {
         return bll.GetSysDictionaryByID(dictID);
     }
 }
Beispiel #13
0
        private StringBuilder GetEmployeeAttendBody(string CompanyName, string Strdate, List <V_LEFTOFFICEVIEW> Collects)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("<body>\n\r");
            stringBuilder.Append("<table ID=\"Table0\" BORDER=1 CELLSPACING=1 CELLPADDING=3 width=100% align=center>\n\r");
            stringBuilder.Append("<tr>");
            stringBuilder.Append("<table border=1 cellspacing=0 CELLPADDING=3 width=100% align=center>");
            stringBuilder.Append("<tr>");
            stringBuilder.Append("<td align=center class=\"title\" >员工编号</td>");
            stringBuilder.Append("<td align=center class=\"title\" >员工姓名</td>");
            stringBuilder.Append("<td align=center class=\"title\" >离职类型</td>");
            stringBuilder.Append("<td align=center class=\"title\" >入职时间</td>");
            stringBuilder.Append("<td align=center class=\"title\" >离职时间</td>");
            stringBuilder.Append("<td align=center class=\"title\" >申请时间</td>");
            stringBuilder.Append("<td align=center class=\"title\" >审批状态</td>");
            stringBuilder.Append("<td align=center class=\"title\" >是否确认</td>");
            stringBuilder.Append("</tr>");
            if (Collects.Count <V_LEFTOFFICEVIEW>() > 0)
            {
                SysDictionaryBLL bll = new SysDictionaryBLL();

                List <TM_SaaS_OA_EFModel.T_SYS_DICTIONARY> sysDictionaryByCategoryList = bll.GetSysDictionaryByCategory(new List <string>
                {
                    "LEFTOFFICECATEGORY",
                    "CHECKSTATE"
                });
                int i;
                for (i = 0; i < Collects.Count; i++)
                {
                    stringBuilder.Append("<tr>");
                    stringBuilder.Append("<td class=\"x1282\">" + Collects[i].EMPLOYEECODE + "</td>");
                    stringBuilder.Append("<td class=\"x1282\">" + Collects[i].EMPLOYEECNAME + "</td>");
                    stringBuilder.Append("<td class=\"x1282\">" + sysDictionaryByCategoryList.Where(t => t.DICTIONARYVALUE == Convert.ToInt32(Collects[i].LEFTOFFICECATEGORY) && t.DICTIONCATEGORY == "LEFTOFFICECATEGORY").FirstOrDefault().DICTIONARYNAME + "</td>");
                    stringBuilder.Append("<td class=\"x1282\">" + Collects[i].ENTRYDATE.Value.ToString("yyyy-MM-dd") + "</td>");
                    stringBuilder.Append("<td class=\"x1282\">" + Collects[i].LEFTOFFICEDATE.Value.ToString("yyyy-MM-dd") + "</td>");
                    stringBuilder.Append("<td class=\"x1282\">" + Collects[i].APPLYDATE.Value.ToString("yyyy-MM-dd") + "</td>");
                    stringBuilder.Append("<td class=\"x1282\">" + sysDictionaryByCategoryList.Where(t => t.DICTIONARYVALUE == decimal.Parse(Collects[i].CHECKSTATE) && t.DICTIONCATEGORY == "CHECKSTATE").FirstOrDefault().DICTIONARYNAME + "</td>");

                    int    num  = Convert.ToInt32(Collects[i].ISCONFIRMED);
                    string str1 = string.Empty;
                    if (num < 0)
                    {
                        str1 = "未确认";
                    }
                    else
                    {
                        if (num >= 0 && num < 2)
                        {
                            str1 = "确认中";
                        }
                        else
                        {
                            if (num == 2)
                            {
                                str1 = "已确认";
                            }
                            else
                            {
                                if (num == 3)
                                {
                                    str1 = "确认未通过";
                                }
                            }
                        }
                    }
                    stringBuilder.Append("<td class=\"x1282\">" + str1 + "</td>");
                    stringBuilder.Append("</tr>");
                }
            }
            stringBuilder.Append("</table>");
            stringBuilder.Append("</body></html>");
            return(stringBuilder);
        }
Beispiel #14
0
        /// <summary>
        /// 数据组装
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="entSignIn"></param>
        /// <returns></returns>
        private DataTable GetDataConversion(DataTable dt, IQueryable <T_HR_EMPLOYEESIGNINDETAIL> entSignIn)
        {
            dt.Rows.Clear();
            foreach (var item in entSignIn)
            {
                try
                {
                    List <T_SYS_DICTIONARY> dic = new List <T_SYS_DICTIONARY>();//new SaaS.BLLCommonServices.PermissionWS.PermissionServiceClient().GetSysDictionaryByCategoryList(new string[] { "ABNORMCATEGORY", "ATTENDPERIOD", "REASONCATEGORY" });//获取字典值
                    using (SysDictionaryBLL bll = new SysDictionaryBLL())
                    {
                        dic = bll.GetSysDictionaryByCategory(new List <string> {
                            "ABNORMCATEGORY", "ATTENDPERIOD", "REASONCATEGORY"
                        });
                    }
                    // nationDict = tmp.Where(s => s.DICTIONCATEGORY == "NATION" && s.DICTIONARYVALUE == nationValue).FirstOrDefault();
                    DataRow row = dt.NewRow();
                    #region 每行数据
                    for (int i = 0; i < dt.Columns.Count; i++)
                    {
                        switch (i)
                        {
                        case 0: row[i] = item.ABNORMALDATE.Value.ToString("yyyy-MM-dd"); break;    //异常日期

                        case 1:
                            decimal?abCategory    = Convert.ToDecimal(item.ABNORMCATEGORY);
                            var     dicAbCategory = dic.Where(s => s.DICTIONCATEGORY == "ABNORMCATEGORY" && s.DICTIONARYVALUE == abCategory).FirstOrDefault();
                            if (dicAbCategory != null)
                            {
                                row[i] = dicAbCategory.DICTIONARYNAME;;     //异常类型
                            }
                            break;

                        case 2:
                            decimal?abOd    = Convert.ToDecimal(item.ATTENDPERIOD);
                            var     dicAbOd = dic.Where(s => s.DICTIONCATEGORY == "ATTENDPERIOD" && s.DICTIONARYVALUE == abOd).FirstOrDefault();
                            if (dicAbOd != null)
                            {
                                row[i] = dicAbOd.DICTIONARYNAME;    //异常时间段
                            }
                            break;

                        case 3: row[i] = item.ABNORMALTIME; break;    //异常时长(分钟)

                        case 4:
                            decimal?reCategory    = Convert.ToDecimal(item.REASONCATEGORY);
                            var     dicReCategory = dic.Where(s => s.DICTIONCATEGORY == "REASONCATEGORY" && s.DICTIONARYVALUE == reCategory).FirstOrDefault();
                            if (dicReCategory != null)
                            {
                                row[i] = dicReCategory.DICTIONARYNAME;;     //异常原因类型
                            }
                            break;

                        case 5: row[i] = item.DETAILREASON; break;    //异常原因
                        }
                    }
                    dt.Rows.Add(row);
                    #endregion
                }
                catch (Exception ex)
                {
                    SMT.Foundation.Log.Tracer.Debug("ExportEmployeeSignIn导出员工签卡信息组装DataTable时出错:" + ex.Message);
                    return(null);
                }
            }
            return(dt);
        }
Beispiel #15
0
 public bool ImportCityCSV(UploadFileModel uploadFile, Dictionary<string, string> empInfoDic, ref string strMsg)
 {
     string strPath = string.Empty;
     SaveFile(uploadFile, out strPath);//获取文件路径
     string strPhysicalPath = System.Web.HttpContext.Current.Server.MapPath(strPath);//到时测试strPath为空是是否报错
     using (SysDictionaryBLL bll = new SysDictionaryBLL())
     {
         return bll.ImportCityCSV(strPhysicalPath, empInfoDic, ref strMsg);
     }
 }
Beispiel #16
0
 public List<T_SYS_DICTIONARY> GetSysDictionarySysType()
 {
     using (SysDictionaryBLL bll = new SysDictionaryBLL())
     {
         return bll.GetSysDictionarySysType();
     }
 }
Beispiel #17
0
        public List<T_SYS_DICTIONARY> GetSysDictionaryByCategory(string category)
        {
            using (SysDictionaryBLL bll = new SysDictionaryBLL())
            {
                //GetSysLeftMenuFilterPermissionToNewFrame("85b414ab-87b3-4740-aef4-1d89f3f380cc");
                IQueryable<T_SYS_DICTIONARY> dictlist = bll.GetSysDictionaryByCategory(category);

                return dictlist != null ? dictlist.ToList() : null;
            }
        }
Beispiel #18
0
 public List<T_SYS_DICTIONARY> GetSysDictionaryByFilter(string filter, string sort, string[] paras)
 {
     using (SysDictionaryBLL bll = new SysDictionaryBLL())
     {
         return bll.GetSysDictionaryByFilter(filter, sort, paras);
     }
 }
Beispiel #19
0
        public List<T_SYS_DICTIONARY> GetAllSysDictionary()
        {
            using (SysDictionaryBLL bll = new SysDictionaryBLL())
            {
                IQueryable<T_SYS_DICTIONARY> dictlist = bll.GetAllSysDictionary();

                return dictlist != null ? dictlist.ToList() : null;
            }
        }
Beispiel #20
0
        public string GetSystemDictioanryVersion()
        {
            using (SysDictionaryBLL bll = new SysDictionaryBLL())
            {
                return bll.ReadVersion();
            }

        }
Beispiel #21
0
 public string GetSysDictionaryByCategoryAndValue(string category, string value)
 {
     using (SysDictionaryBLL bll = new SysDictionaryBLL())
     {
         return bll.GetSysDictionaryByCategoryAndValue(category, value);
     }
 }
Beispiel #22
0
 public List<V_Dictionary> GetDictionaryByCategoryArray(string[] categorys)
 {
     using (SysDictionaryBLL bll = new SysDictionaryBLL())
     {
         IQueryable<V_Dictionary> Listmenus = bll.GetSysDictionaryByCategoryArray(categorys);
         return Listmenus != null ? Listmenus.ToList() : null;
     }
 }
Beispiel #23
0
 public List<T_SYS_DICTIONARY> GetSysDictionaryByFatherID(string fatherID)
 {
     using (SysDictionaryBLL bll = new SysDictionaryBLL())
     {
         IQueryable<T_SYS_DICTIONARY> dictlist = bll.GetSysDictionaryByFatherID(fatherID);
         return dictlist.Count() > 0 ? dictlist.ToList() : null;
     }
 }