コード例 #1
0
ファイル: FrmWF.cs プロジェクト: Yogeswaran66/Testing
        public void RunAgent()
        {
            DoExport objDoExport = new DoExport(this);

            objDoExport.InitialiseAllApiObj();
            objDoExport.DoAgentOps();
        }
コード例 #2
0
        public ActionResult DeriveData()
        {
            ReturnMessage RM = new ReturnMessage();

            try
            {
                string        paramData = Request.Form["paramData"];
                StringBuilder strSql    = new StringBuilder("select LoginName as  '登录名',UserName  as '用户名',dept_New  as '所属部门', 'role_name' as '角色',Remark '备注' from View_User_Role where 1=1");
                if (string.IsNullOrEmpty(paramData))
                {
                    string keyword = Request["keyword"];
                    string Depart  = Request["Depart"];
                    if (!string.IsNullOrWhiteSpace(keyword))
                    {
                        strSql.Append(" and (LoginName like '%" + keyword + "%' or UserName like '%" + keyword + "%')");
                    }
                    if (!string.IsNullOrWhiteSpace(Depart))
                    {
                        strSql.Append(" and (dept_New ='" + Depart + "')");
                    }
                    strSql.Append(" and " + whe);
                }
                else
                {
                    string[] tblRcdidArr = paramData.Split('*');
                    strSql.Append(" and tblrcdid in " + DBContext.DataDecision.AssemblyInCondition(tblRcdidArr.ToList()));
                }
                strSql.Append(" order by LoginName,UserName  ");
                DataTable dt = DBContext.DataDecision.GetDataTable(strSql.ToString());


                DataTable User_Roles_dt = DBContext.DataDecision.GetDataTable("select distinct LoginName,Role_Name from dbo.View_User_Roles where LoginName is not null and LoginName<>'' and  Role_Name is not null and Role_Name<>'' order by LoginName,Role_Name");

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string    LoginName     = Convert.ToString(dt.Rows[i]["登录名"]);
                    string    Role_NameList = "";
                    DataRow[] datarow       = User_Roles_dt.Select("LoginName='" + LoginName + "'");
                    for (int j = 0; j < datarow.Length; j++)
                    {
                        Role_NameList += Convert.ToString(datarow[j]["Role_Name"]) + ",";
                    }
                    dt.Rows[i]["角色"] = Role_NameList;
                }
                string sheetName = "用户表";
                //返回路径
                string absoluFilePath = DoExport.ExportDataTableToExcel(dt, sheetName, "用户表");
                RM.IsSuccess = true;
                RM.Text      = HttpUtility.UrlEncode(absoluFilePath);
            }
            catch (Exception ex)
            {
                RM.IsSuccess = false;
                RM.Message   = ex.Message;
            }
            return(Json(RM, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
ファイル: uSyncTriggers.cs プロジェクト: KevinJump/uSync
 /// <summary>
 ///  trigger an export of an item programatically.
 /// </summary>
 /// <param name="folder">folder to use for export</param>
 /// <param name="entityTypes">entity types to trigger export for</param>
 /// <param name="options">handler options to use for handlers</param>
 public static void TriggerExport(string folder, IEnumerable <string> entityTypes, SyncHandlerOptions options)
 {
     DoExport?.Invoke(new uSyncTriggerArgs()
     {
         EntityTypes    = entityTypes,
         Folder         = folder,
         HandlerOptions = options
     });
 }
コード例 #4
0
ファイル: FunctionalController.cs プロジェクト: radtek/ITMS
        public ActionResult DeriveData()
        {
            ReturnMessage RM = new ReturnMessage();

            try
            {
                string paramData = Request.Form["paramData"];
                //StringBuilder strSql = new StringBuilder("select  Module_Name '模块名称 ',Module_Id '模块ID ', Group_Name '分组名称 ',Group_Id '分组ID', Right_Name '页面名称 ',Right_Id '页面ID',Right_Url '页面路径',Remark as '备注'  from FunctionalAuthority  where  1=1");
                StringBuilder strSql = new StringBuilder("select  Module_Name '模块名称 ', Group_Name '分组名称 ', Right_Name '页面名称 ',Right_Url '页面路径',Remark as '备注'  from FunctionalAuthority  where  1=1");
                if (string.IsNullOrEmpty(paramData))
                {
                    string Module_Name = Request["Module_Name"];
                    string Group_Name  = Request["Group_Name"];
                    string Right_Name  = Request["Right_Name"];
                    StringBuilder where = new StringBuilder(" 1=1");
                    if (!string.IsNullOrWhiteSpace(Module_Name))
                    {
                        where.Append(" and Module_Name like '%" + Module_Name + "%'");
                    }
                    if (!string.IsNullOrWhiteSpace(Group_Name))
                    {
                        where.Append(" and Group_Name like '%" + Group_Name + "%'");
                    }
                    if (!string.IsNullOrWhiteSpace(Right_Name))
                    {
                        where.Append(" and Right_Name like '%" + Right_Name + "%'");
                    }
                    strSql.Append(" and " + where.ToString());
                }
                else
                {
                    string[] RidArr = paramData.Split('*');
                    strSql.Append(" and  Rid in " + DBContext.DataDecision.AssemblyInCondition(RidArr.ToList()));
                }
                strSql.Append(" order by Module_Id,Group_Id,Right_Id");

                DataTable dt        = DBContext.DataDecision.GetDataTable(strSql.ToString());
                string    sheetName = "模块信息";
                //返回路径
                string absoluFilePath = DoExport.ExportDataTableToExcel(dt, sheetName, "模块信息");

                RM.IsSuccess = true;
                RM.Text      = HttpUtility.UrlEncode(absoluFilePath);
            }
            catch (Exception ex)
            {
                RM.IsSuccess = false;
                RM.Message   = ex.Message;
            }
            return(Json(RM, JsonRequestBehavior.AllowGet));
        }
コード例 #5
0
ファイル: PageRecordController.cs プロジェクト: radtek/ITMS
        public ActionResult DeriveData()
        {
            ReturnMessage RM = new ReturnMessage();

            try
            {
                string   paramData  = Request.Form["paramData"];
                string   PageTitle  = Request["PageTitle"];
                string   PageUrl    = Request["PageUrl"];
                string   ViewCount  = Request["ViewCount"];
                string   RecordDate = Request["RecordDate"];
                DateTime now        = DateTime.Now;
                string   stateDate  = null;
                string   endDate    = null;
                string where = " 1=1 ";
                if (!string.IsNullOrWhiteSpace(stateDate))
                {
                    where += " and (RecordDate>='" + stateDate + "')";
                }
                if (!string.IsNullOrEmpty(endDate))
                {
                    where += " and (RecordDate<= '" + endDate + "')";
                }

                StringBuilder strSql = new StringBuilder();

                strSql.Append("select ");
                strSql.Append("PageTitle as '页面标题'");
                strSql.Append(",PageUrl as '页面路径'");
                strSql.Append(",count(Rid) as '访问数量'");
                strSql.Append(" from tblPageView");
                strSql.Append(" where" + where);
                strSql.Append("group by PageTitle, PageUrl");

                DataTable dt = DBContext.DataDecision.GetDataTable(strSql.ToString());

                string sheetName = "页面访问统计";
                //返回路径
                string absoluFilePath = DoExport.ExportDataTableToExcel(dt, sheetName, "页面访问统计");
                RM.IsSuccess = true;
                RM.Text      = HttpUtility.UrlEncode(absoluFilePath);
            }
            catch (Exception e)
            {
                RM.IsSuccess = false;
                RM.Message   = e.Message;
            }
            return(Json(RM, JsonRequestBehavior.AllowGet));
        }
コード例 #6
0
ファイル: MessageController.cs プロジェクト: radtek/ITMS
        public ActionResult DeriveData()
        {
            ReturnMessage RM = new ReturnMessage();

            try
            {
                string        paramData = Request.Form["paramData"];
                StringBuilder strSql    = new StringBuilder("1=1");

                if (string.IsNullOrWhiteSpace(paramData))
                {
                    strSql = new StringBuilder("select Sender as '发送人', Accepter as '接收人', MsgType as '消息类型', MsgTitle as '消息标题', MsgContent as '消息内容', CONVERT(varchar, SendDate, 23 ) as '发送日期' from tblMessage  ");

                    string loginName = CurrentHelper.CurrentUser.User.UserName.ToString();

                    strSql.Append(" where  1=1 and Accepter='" + loginName + "'");
                    //string Accepter = Request.Form["Accepter"];//接收人
                    //if (!string.IsNullOrWhiteSpace(Accepter))
                    //{
                    //    strSql.Append(" and (Accepter like '%" + Accepter + "%')");
                    //}
                    strSql.Append(" order by  SendDate  desc");
                }
                else
                {
                    string[] RidArr = paramData.Split('*');
                    strSql = new StringBuilder("select Sender as '发送人', Accepter as '接收人', MsgType as '消息类型', MsgTitle as '消息标题', MsgContent as '消息内容', CONVERT(varchar, SendDate, 23 ) as '发送日期' from tblMessage  where Rid in " + DBContext.DataDecision.AssemblyInCondition(RidArr.ToList()));

                    strSql.Append(" order by  SendDate  desc");
                }

                DataTable dt = DBContext.DataDecision.GetDataTable(strSql.ToString());


                string sheetName = "个人消息列表 ";
                //返回路径
                string absoluFilePath = DoExport.ExportDataTableToExcel(dt, sheetName, "个人消息列表");

                RM.IsSuccess = true;
                RM.Text      = HttpUtility.UrlEncode(absoluFilePath);
            }
            catch (Exception ex)
            {
                RM.IsSuccess = false;
                RM.Message   = ex.Message;
            }
            return(Json(RM, JsonRequestBehavior.AllowGet));
        }
コード例 #7
0
ファイル: AdOperActionService.cs プロジェクト: radtek/ITMS
        /// <summary>
        /// 根据条件获取日常工作记录数据下载地址
        /// </summary>
        /// <param name="ids">id列表,id列表为空则根据其他条件查询</param>
        /// <param name="Seller">业务员</param>
        /// <param name="Actor">客户名称</param>
        /// <param name="queryFields">查询字段,默认查询全部</param>
        /// <param name="orderBy">排序条件</param>
        /// <returns>返回下载文件地址</returns>
        public string GetDownloadPathCalendar(List <int> ids, string Seller = null, string Actor = null, string queryFields = "*", string orderBy = "")
        {
            string path = string.Empty;

            try
            {
                queryFields = @"Seller as '业务员',Convert(varchar(100),AffairTime,23) as '拜访日期'
                            ,case IsRegister when 1 then '是' else  '否' end as '已登记',Actor as '客户名称',AdContent as '广告品牌'
                            ,Place as '地点'
                            ,Subject as '主题'
                            ,Content as '事件描述'
                            ,ContractName1 as '联系人'
                            ,Convert(varchar(100),RegDate,23) as '登记日期'
                            ,Remark as '备注' ";
                if (String.IsNullOrWhiteSpace(orderBy))
                {
                    orderBy = " TblRcdId Desc";
                }
                StringBuilder where = new StringBuilder(" 1=1");
                if (ids == null || ids.Count == 0)
                {
                    if (!string.IsNullOrWhiteSpace(Seller))
                    {
                        where.Append(" and Seller = '" + Seller + "'");
                    }
                    if (!string.IsNullOrWhiteSpace(Actor))
                    {
                        where.Append(" and Actor like '%" + Actor + "%'");
                    }
                }
                else
                {
                    where.Append(" and TblRcdId in " + DBContext.PTMMHZ.AssemblyInCondition(ids));
                }
                string    sql       = string.Format("select {0} from tblCalendar where {1} order by {2}", queryFields, where.ToString(), orderBy);
                DataTable dt        = DBContext.PTMMHZ.GetDataTable(sql);
                string    sheetName = "日常工作记录";
                path = DoExport.ExportDataTableToExcel(dt, sheetName, sheetName);
            }
            catch (Exception ex)
            {
                Bitshare.PTMM.Common.LogManager.Error("GetDownloadPathCalendar()", ex);
            }
            return(path);
        }
コード例 #8
0
        public ActionResult DeriveData(string keyword = null)
        {
            ReturnMessage RM = new ReturnMessage();

            try
            {
                string paramData = Request.Form["paramData"];

                StringBuilder strSql = new StringBuilder("1=1");

                strSql = new StringBuilder("select UserName as '职员 ', Leader as '直隶上级', ReMark  as '备注'  from tblLevelManange  where  1=1");
                if (string.IsNullOrEmpty(paramData))
                {
                    string UserName = Request["UserName"];
                    string Leader   = Request["Leader"];
                    if (!string.IsNullOrWhiteSpace(keyword))
                    {
                        strSql.AppendFormat(" and (UserName like '%{0}%' or Leader like '%{0}%')", keyword);
                    }
                }
                else
                {
                    string[] tblRcdidArr = paramData.Split('*');
                    strSql.Append(" and  TblRcdId in " + DBContext.DataDecision.AssemblyInCondition(tblRcdidArr.ToList()));
                }
                strSql.Append(" order by UserName");

                DataTable dt        = DBContext.DataDecision.GetDataTable(strSql.ToString());
                string    sheetName = "业务上下级信息表";
                //返回路径
                string absoluFilePath = DoExport.ExportDataTableToExcel(dt, sheetName, "业务上下级信息表");

                RM.IsSuccess = true;
                RM.Text      = HttpUtility.UrlEncode(absoluFilePath);
            }
            catch (Exception ex)
            {
                RM.IsSuccess = false;
                RM.Message   = ex.Message;
            }
            return(Json(RM, JsonRequestBehavior.AllowGet));
        }
コード例 #9
0
ファイル: ButtonNameController.cs プロジェクト: radtek/ITMS
        public ActionResult DeriveData()
        {
            ReturnMessage RM = new ReturnMessage();

            try
            {
                string        paramData = Request.Form["paramData"];
                StringBuilder strSql    = new StringBuilder("select  ButtonName '按钮名称 ', Remark as '备注'  from tblButtonName  where  1=1");
                if (string.IsNullOrEmpty(paramData))
                {
                    string keyword = Request.QueryString["keyword"];
                    if (!string.IsNullOrWhiteSpace(keyword))
                    {
                        strSql.Append(" and (ButtonName like '%" + keyword + "%')");
                    }
                    strSql.Append(" and " + whe);
                }
                else
                {
                    string[] RidArr = paramData.Split('*');
                    strSql.Append(" and  Rid in " + DBContext.DataDecision.AssemblyInCondition(RidArr.ToList()));
                }
                strSql.Append(" order by ButtonName");

                DataTable dt        = DBContext.DataDecision.GetDataTable(strSql.ToString());
                string    sheetName = "按钮名称";
                //返回路径
                string absoluFilePath = DoExport.ExportDataTableToExcel(dt, sheetName, "按钮名称");

                RM.IsSuccess = true;
                RM.Text      = HttpUtility.UrlEncode(absoluFilePath);
            }
            catch (Exception ex)
            {
                RM.IsSuccess = false;
                RM.Message   = ex.Message;
            }
            return(Json(RM, JsonRequestBehavior.AllowGet));
        }
コード例 #10
0
        public ActionResult DeriveData()
        {
            ReturnMessage RM = new ReturnMessage();

            try
            {
                string        paramData = Request.Form["paramData"];
                StringBuilder strSql    = new StringBuilder("select  ProcessName as '流程名称',  NodeName as '节点名称',NoticeRole as '通知角色', Remark  as '备注'  from tblProcessNotice  where  1=1");
                if (string.IsNullOrEmpty(paramData))
                {
                    string ProcessName = Request.Form["ProcessName"];
                    if (!string.IsNullOrWhiteSpace(ProcessName))
                    {
                        strSql.Append(" and (ProcessName like '%" + ProcessName + "%')");
                    }
                    strSql.Append(" and " + wheres);
                }
                else
                {
                    string[] tblRcdidArr = paramData.Split('*');
                    strSql.Append(" and  TblRcdId in " + DBContext.DataDecision.AssemblyInCondition(tblRcdidArr.ToList()));
                }
                strSql.Append(" order by ProcessName");

                DataTable dt        = DBContext.DataDecision.GetDataTable(strSql.ToString());
                string    sheetName = "流程消息设置表";
                //返回路径
                string absoluFilePath = DoExport.ExportDataTableToExcel(dt, sheetName, "流程消息设置表");

                RM.IsSuccess = true;
                RM.Text      = HttpUtility.UrlEncode(absoluFilePath);
            }
            catch (Exception ex)
            {
                RM.IsSuccess = false;
                RM.Message   = ex.Message;
            }
            return(Json(RM, JsonRequestBehavior.AllowGet));
        }
コード例 #11
0
ファイル: PageDetailController.cs プロジェクト: radtek/ITMS
        public ActionResult DeriveData()
        {
            ReturnMessage RM = new ReturnMessage();

            try
            {
                string        paramData   = Request.Form["paramData"];
                string[]      tblRcdidArr = paramData.Split('*');
                StringBuilder strSql      = new StringBuilder("select ModelName as '模块名称', PageName as '页面名称',DetailName as '明细名称', Remark as '备注' from tblPageDetail where 1=1 ");
                if (string.IsNullOrEmpty(paramData))
                {
                    string keyword = Request["keyword"];
                    if (!string.IsNullOrWhiteSpace(keyword))
                    {
                        strSql.Append(" and (ModelName like '%" + keyword + "%' or PageName like '%" + keyword + "%')");
                    }
                }
                else
                {
                    strSql.Append(" and  TblRcdId in " + DBContext.DataDecision.AssemblyInCondition(tblRcdidArr.ToList()));
                }
                strSql.Append(" order by ModelName,PageName,DetailName");
                DataTable dt = DBContext.DataDecision.GetDataTable(strSql.ToString());


                string sheetName = "明细权限管理";
                //返回路径
                string absoluFilePath = DoExport.ExportDataTableToExcel(dt, sheetName, "明细权限管理");

                RM.IsSuccess = true;
                RM.Text      = HttpUtility.UrlEncode(absoluFilePath);
            }
            catch (Exception ex)
            {
                RM.IsSuccess = false;
                RM.Message   = ex.Message;
            }
            return(Json(RM, JsonRequestBehavior.AllowGet));
        }
コード例 #12
0
        public ActionResult DeriveData()
        {
            ReturnMessage RM = new ReturnMessage();

            try
            {
                string        paramData = Request.Form["paramData"];
                StringBuilder strSql    = new StringBuilder("select  role_name '角色名', role_desc as '备注'  from sys_role  where  1=1");
                if (string.IsNullOrEmpty(paramData))
                {
                    string roleName = Request.QueryString["roleName"];
                    if (!string.IsNullOrWhiteSpace(roleName))
                    {
                        strSql.Append(" and (role_name like '%" + roleName + "%')");
                    }
                    strSql.Append(" and " + whe);
                }
                else
                {
                    string[] tblRcdidArr = paramData.Split('*');
                    strSql.Append(" and  TblRcdId in " + DBContext.DataDecision.AssemblyInCondition(tblRcdidArr.ToList()));
                }
                strSql.Append(" order by role_name");

                DataTable dt        = DBContext.DataDecision.GetDataTable(strSql.ToString());
                string    sheetName = "角色表";
                //返回路径
                string absoluFilePath = DoExport.ExportDataTableToExcel(dt, sheetName, "角色表");

                RM.IsSuccess = true;
                RM.Text      = HttpUtility.UrlEncode(absoluFilePath);
            }
            catch (Exception ex)
            {
                RM.IsSuccess = false;
                RM.Message   = ex.Message;
            }
            return(Json(RM, JsonRequestBehavior.AllowGet));
        }