private static void WriteLog(RequestSession session, int read, string state, string message = "")
 {
     var url = session.TargetUrl;
     if (url.Length > 80)
     {
         url = url.Substring(0, 80);
     }
     session.WriteLoop++;
     session.WriteBytes = read;
     session.WriteTotalBytes += read;
     Logger.Log("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}", session.Id, state, session.WriteLoop,
         session.WriteBytes, session.WriteTotalBytes, url, message);
 }
Example #2
0
        private void initdata()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat(@"--合同数
SELECT COUNT(1) FROM View_Contract WHERE datediff(month,CreateDate,getdate())=0

--待审批
SELECT COUNT(1) FROM View_Approve VA , Base_UserRole BUR WHERE VA.RoleId=BUR.Roles_ID AND WFStatus=1 AND BUR.User_ID='{0}'

--已审批
SELECT COUNT(1) FROM WF_Process WHERE ApproverID='' AND  datediff(month,CreateTime,getdate())=0

--作废审批

SELECT COUNT(1) FROM View_Approve VA , Base_UserRole BUR WHERE VA.RoleId=BUR.Roles_ID AND WFStatus=4 AND BUR.User_ID='{0}'
--申请贷款
SELECT SUM(CONVERT(int,M_Loan)) FROM View_Contract WHERE datediff(month,CreateDate,getdate())=0

--发放贷款
SELECT SUM(M_Loan) FROM View_Contract VC LEFT JOIN WF_WorkFlow WF ON VC.UID=WF.ContractId WHERE datediff(month,CreateDate,getdate())=0 AND WF.IsFinish=1
--等额本金
SELECT SUM(CONVERT(int,M_Loan)) FROM View_Contract WHERE datediff(month,CreateDate,getdate())=0 AND M_Replay_Type='等额本金'


--等额本息

SELECT SUM(CONVERT(int,M_Loan)) FROM View_Contract WHERE datediff(month,CreateDate,getdate())=0 AND M_Replay_Type='等额本息'
--统计时间
SELECT GETDATE() ", RequestSession.GetSessionUser().UserId.ToString());


            DataSet ds = DataFactory.SqlDataBase().GetDataSetBySQL(sb);

            Items = new string[ds.Tables.Count];
            for (int i = 0; i < ds.Tables.Count; i++)
            {
                Items[i] = ds.Tables[i].Rows[0][0].ToString();
            }
        }
Example #3
0
        public bool AddUserGroupMenber(string[] User_ID, string UserGroup_ID)
        {
            bool result;

            try
            {
                StringBuilder[] sqls  = new StringBuilder[User_ID.Length];
                object[]        objs  = new object[User_ID.Length];
                int             index = 0;
                for (int i = 0; i < User_ID.Length; i++)
                {
                    string item = User_ID[i];
                    if (item.Length > 0)
                    {
                        StringBuilder sbadd = new StringBuilder();
                        sbadd.Append("Insert into Base_UserInfoUserGroup(");
                        sbadd.Append("UserInfoUserGroup_ID,User_ID,UserGroup_ID,CreateUserId,CreateUserName");
                        sbadd.Append(")Values(");
                        sbadd.Append("@UserInfoUserGroup_ID,@User_ID,@UserGroup_ID,@CreateUserId,@CreateUserName)");
                        SqlParam[] parmAdd = new SqlParam[]
                        {
                            new SqlParam("@UserInfoUserGroup_ID", CommonHelper.GetGuid),
                            new SqlParam("@User_ID", item),
                            new SqlParam("@UserGroup_ID", UserGroup_ID),
                            new SqlParam("@CreateUserId", RequestSession.GetSessionUser().UserId),
                            new SqlParam("@CreateUserName", RequestSession.GetSessionUser().UserName)
                        };
                        sqls[index] = sbadd;
                        objs[index] = parmAdd;
                        index++;
                    }
                }
                result = (DataFactory.SqlDataBase().BatchExecuteBySql(sqls, objs) >= 0);
            }
            catch
            {
                result = false;
            }
            return(result);
        }
Example #4
0
        protected void btn_save_Click(object sender, EventArgs e)
        {
            Hashtable ht = new Hashtable();

            ht = ControlBindHelper.GetWebControls(this.Page);

            if (string.IsNullOrEmpty(this.UPID))
            {
                DataTable dt = ciDal.GetUserPledgeByUID(UID);
                if (DataTableHelper.IsExistRows(dt))
                {
                    if (dt.Rows.Count >= 5)
                    {
                        ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>layer.msg('最多只能上传5条!');</script>");
                        return;
                    }
                }
            }
            if (!string.IsNullOrEmpty(this.UPID))
            {
                ht["ModifyUser"] = RequestSession.GetSessionUser().UserName.ToString();
                ht["ModifyDate"] = DateTime.Now.ToString();
            }
            else
            {
                ht["CreateUser"] = RequestSession.GetSessionUser().UserName.ToString();
                ht["UID"]        = UID;
            }

            bool IsOk = DataFactory.SqlDataBase().Submit_AddOrEdit("User_Pledge", "UPID", this.UPID, ht);

            if (IsOk)
            {
                ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>layer.msg('保存成功!'); window.location.href = '/Contract/User_GuaranteeForm2.aspx?UID=" + UID + "';</script>");
            }
            else
            {
                ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>layer.msg('保存失败!');</script>");
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Hdhoteladmin.Value = RequestSession.GetSessionUser().AdminHotelid.ToString();
                bool   blHotelTree = false; //是否有多分店权限 多店显示酒店树
                string HotelId     = "";    //如果只有一家店 默认的酒店ID

                if (RequestSession.GetSessionUser().Hotelid.ToString() == "0")
                {
                    hotelTreeHtml = HotelTreeHelper.HotelTree(Hdhoteladmin.Value, 1, out blHotelTree, out HotelId);
                }
                else
                {
                    blHotelTree = false;
                    HotelId     = RequestSession.GetSessionUser().Hotelid.ToString();
                }
                HotelTree.Visible = blHotelTree;
                htHotelTree.Value = blHotelTree.ToString();
                hdHotelId.Value   = HotelId;
            }
        }
Example #6
0
        /// <summary>
        /// 确认事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Accept_Click(object sender, EventArgs e)
        {
            bool IsOk = false;

            bpms_tablecolumns             = ControlBindHelper.GetWebControls <BPMS_TableColumns>(this.Page);
            bpms_tablecolumns.MenuId      = _Menu_Id;
            bpms_tablecolumns.IsPublic    = IsPublic.Checked ? 1 : 0;
            bpms_tablecolumns.IsHidden    = IsHidden.Checked ? 1 : 0;
            bpms_tablecolumns.Enabled     = Enabled.Checked ? 1 : 0;
            bpms_tablecolumns.AllowEdit   = AllowEdit.Checked ? 1 : 0;
            bpms_tablecolumns.AllowDelete = AllowDelete.Checked ? 1 : 0;
            if (!string.IsNullOrEmpty(_key))//判断是否编辑
            {
                bpms_tablecolumns.TableColumnsId = _key;
                bpms_tablecolumns.ModifyDate     = DateTime.Now;
                bpms_tablecolumns.ModifyUserId   = RequestSession.GetSessionUser().UserId;
                bpms_tablecolumns.ModifyUserName = RequestSession.GetSessionUser().UserName;
                IsOk = bpms_tablecolumnsibll.Update(bpms_tablecolumns);
                if (IsOk)
                {
                    ShowMsgHelper.AlertCallback(MessageHelper.MSG0006);
                }
            }
            else
            {
                bpms_tablecolumns.TableColumnsId = CommonHelper.GetGuid;
                bpms_tablecolumns.CreateUserId   = RequestSession.GetSessionUser().UserId;
                bpms_tablecolumns.CreateUserName = RequestSession.GetSessionUser().UserName;
                IsOk = bpms_tablecolumnsibll.Insert(bpms_tablecolumns);
                if (IsOk)
                {
                    ShowMsgHelper.AlertCallback(MessageHelper.MSG0005);
                }
            }
            if (!IsOk)
            {
                ShowMsgHelper.Alert_Error(MessageHelper.MSG0022);
            }
        }
Example #7
0
        /// <summary>
        /// 保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                Hashtable ht = new Hashtable();
                ht["CategoryID"] = CategoryID.Value;
                // 文章名称
                ht["ArticleName"] = ArticleName.Value;
                // 文章内容
                ht["ArticleContent"] = ArticleContent.Value;
                ht["Sort"]           = string.IsNullOrEmpty(Sort.Value) ? "9999" : Sort.Value;
                ht["ReleaseTime"]    = DateTime.Now;
                ht["Releaser"]       = RequestSession.GetSessionUser().UserName;
                if (!string.IsNullOrEmpty(_key))
                {
                    ht["ID"] = _key;
                }
                else
                {
                    ht["ID"]         = CommonHelper.GetGuid;
                    ht["DeleteMark"] = "1";
                    ht["SysFlag"]    = "0";
                }

                bool returnValue = articleManager.AddOrEditArticleInfo(ht, _key);
                if (returnValue)
                {
                    ShowMsgHelper.AlertMsg("操作成功!");
                }
                else
                {
                    ShowMsgHelper.Alert_Error("操作失败!");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string    UserId    = RequestSession.GetSessionUser().UserId.ToString();//用户ID
            DataTable dt_Button = systemidao.GetButtonHtml(UserId);

            if (DataTableHelper.IsExistRows(dt_Button))
            {
                foreach (DataRow dr in dt_Button.Rows)
                {
                    sb_Button.Append("<a title=\"" + dr["Menu_Title"].ToString() + "\" onclick=\"" + dr["NavigateUrl"].ToString() + ";\" class=\"button green\">");
                    sb_Button.Append("<span class=\"icon-botton\" style=\"background: url('/Themes/images/16/" + dr["Menu_Img"].ToString() + "') no-repeat scroll 0px 4px;\"></span>");
                    sb_Button.Append(dr["Menu_Name"].ToString());
                    sb_Button.Append("</a>");
                }
            }
            else
            {
                sb_Button.Append("<a class=\"button green\">");
                sb_Button.Append("无操作按钮");
                sb_Button.Append("</a>");
            }
        }
Example #9
0
        /// <summary>
        /// 保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                Hashtable ht = new Hashtable();
                ht["ModelID"]     = ModelID.Value;
                ht["CityID"]      = CityID.Value;
                ht["MinutePrice"] = MinutePrice.Value;
                ht["KmPrice"]     = KmPrice.Value;
                ht["MinPrice"]    = MinPrice.Value;
                ht["MaxPrice"]    = MaxPrice.Value;
                ht["Operator"]    = RequestSession.GetSessionUser().UserName;
                if (!string.IsNullOrEmpty(_key))
                {
                    ht["ID"]         = _key;
                    ht["UpdateTime"] = DateTime.Now;
                }
                else
                {
                    ht["ID"]         = CommonHelper.GetGuid;
                    ht["CreateTime"] = DateTime.Now;
                    ht["DeleteMark"] = 1;
                }

                bool returnValue = manager.AddOrEdit(ht, _key);
                if (returnValue)
                {
                    ShowMsgHelper.AlertMsgNoFresh("操作成功!");
                }
                else
                {
                    ShowMsgHelper.Alert_Error("操作失败!");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #10
0
        private string gethy(string ishy)
        {
            string strgethy = "";

            ishy = ishy.TrimEnd(',');
            ishy = ishy.Replace(",", "','");
            ishy = "'" + ishy + "'";
            StringBuilder sql = new StringBuilder();

            sql.AppendFormat("SELECT * FROM dbo.hy_hylxbmb WHERE hylxcode IN({0}) ", ishy);
            DataTable dt = DataFactory.SqlDataBase(RequestSession.GetSessionUser().AdminHotelid.ToString()).GetDataTableBySQL(sql);

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    strgethy += dt.Rows[i]["hylxname"].ToString() + ",";
                }
            }
            strgethy = strgethy.TrimEnd(',');
            return(strgethy);
        }
Example #11
0
        public void gethtmlss(HttpContext context)
        {
            string TbHtml = "";

            #region ***** 加载表格 *****
            DataTable dt = CommonMethod.GetVip(RequestSession.GetSessionUser().AdminHotelid.ToString());
            if (dt != null && dt.Rows.Count > 0)
            {
                //头部标题

                //<div class="sjxs clearfix" style=" display:"><span>微会员购买升级形式/说明</span><input type="text" name="name" value="" /></div>

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    TbHtml += "<div class='sjxs clearfix' style=' display:'><span>" + dt.Rows[i]["LevelName"].ToString() + "购买升级形式/说明</span><input type='text' jb='" + dt.Rows[i]["code"].ToString() + "' class='sm' name='name'  /></div>";
                }
            }
            #endregion


            context.Response.Write(TbHtml);
        }
Example #12
0
        public void SetEWM()
        {
            string        AdminHotelid = RequestSession.GetSessionUser().AdminHotelid.ToString();
            StringBuilder sql          = new StringBuilder();

            sql.AppendFormat("SELECT Pattern FROM Hotel_Admin  WHERE AdminHotelid='{0}' ", AdminHotelid);
            DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sql);

            if (dt != null && dt.Rows.Count > 0)
            {
                if (dt.Rows[0][0].ToString().Trim() == "4")
                {
                    zdyewm.Visible = false;
                    tgewm.Style.Add("width", "100%");
                    tgewm.Style.Add("text-align", "center");
                    tgewm.Style.Add("margin-right", "0");
                    EWM.Style.Add("padding-left", "0");
                    EWM.Style.Add("width", "100%");
                    //tgewm.Style.Add("margin-right", "auto");
                }
            }
        }
Example #13
0
        public string SourceMaterialInfo(HttpContext context)
        {
            string result = "";
            int    id     = Convert.ToInt32(context.Request["id"]);

            pageNum  = Convert.ToInt32(context.Request["limit"]);
            PageSize = Convert.ToInt32(context.Request["page"]);
            try
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("id");
                dt.Columns.Add("Start");
                var user = RequestSession.GetSessionUser();
                if (user != null)
                {
                    using (var db = new UdowsYunPublicEntities())
                    {
                        List <MaterialInfo> list = db.MaterialInfo.Where(p => p.M_id == id && p.IsDelete == 0).OrderByDescending(p => p.id).Skip((PageSize - 1) * pageNum).Take(pageNum).ToList();
                        if (list.Any())
                        {
                            foreach (var val in list)
                            {
                                DataRow dr = dt.NewRow();
                                dr["id"]    = val.id;
                                dr["Start"] = val.Start == 0 ? "未审核" : "已通过";
                                dt.Rows.Add(dr);
                            }
                        }
                        result = "{\"code\":0,\"msg\":\"\",\"count\":" + db.MaterialInfo.Count(p => p.M_id == id) + ",\"data\":" + JsonConvert.SerializeObject(dt) + "}";
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
            return(result);
        }
Example #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string AdminHotelid = RequestSession.GetSessionUser().AdminHotelid.ToString();
                txtCreateTime.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm");

                StringBuilder str = new StringBuilder();
                str.Append(string.Format(" SELECT * FROM hy_hylxbmb  WHERE AdminHotelid=@AdminHotelid "));
                List <SqlParam> ilistStr = new List <SqlParam>();
                ilistStr.Add(new SqlParam("@AdminHotelid", AdminHotelid));
                str.Append("  ORDER BY Sort DESC");
                DataTable dtstr = DataFactory.SqlDataBase(AdminHotelid).GetDataTableBySQL(str, ilistStr.ToArray());
                if (dtstr != null && dtstr.Rows.Count > 0)
                {
                    this.ddlMemberLevel.DataSource     = dtstr;
                    this.ddlMemberLevel.DataTextField  = "hylxname";
                    this.ddlMemberLevel.DataValueField = "hylxcode";
                    this.ddlMemberLevel.DataBind();
                }
            }
        }
Example #15
0
        public void LoadAction()
        {
            Response.Buffer          = true;
            Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
            Response.Expires         = 0;
            Response.CacheControl    = "no-cache";
            Response.AddHeader("Pragma", "No-Cache");

            string active = HttpContext.Current.Request["action"];                                          //提交类型
            string key    = HttpContext.Current.Request["key"];                                             //主键

            switch (active)
            {
            case "GetMenuTree":    //主功能项
                Response.Write(GetMenuTree());
                Response.End();
                break;

            case "Submenu":    //子功能项
                Response.Write(Submenu(key));
                Response.End();
                break;

            case "AddMenu":    //添加菜单到首页快捷
                bpms_shortcut.MenuId = key;
                bpms_shortcut.UserId = RequestSession.GetSessionUser().UserId;
                Response.Write(bpms_shortcutibll.Insert(bpms_shortcut));
                Response.End();
                break;

            case "Delete":    //移除
                Response.Write(bpms_shortcutibll.Delete(key, RequestSession.GetSessionUser().UserId));
                Response.End();
                break;

            default:
                break;
            }
        }
        public void GetTreeNode()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("SELECT DISTINCT(Recyclebin_Name) FROM Base_Recyclebin where CreateUserId = @CreateUserId");
            SqlParam[] para = new SqlParam[]
            {
                new SqlParam("@CreateUserId", RequestSession.GetSessionUser().UserId)
            };
            DataTable Recyclebin_dt = DataFactory.SqlDataBase().GetDataTableBySQL(strSql, para);
            DataView  dv            = new DataView(Recyclebin_dt);

            if (dv.Count > 0)
            {
                this.strHtml.Append("<ul>");
                foreach (DataRowView drv in dv)
                {
                    this.strHtml.Append("<li>");
                    this.strHtml.Append(string.Concat(new object[]
                    {
                        "<div onclick=\"GetRecyclebin_Name('",
                        drv["Recyclebin_Name"].ToString(),
                        "')\">",
                        drv["Recyclebin_Name"],
                        "</div>"
                    }));
                    this.strHtml.Append("</li>");
                }
                this.strHtml.Append("</ul>");
            }
            else
            {
                this.strHtml.Append("<ul>");
                this.strHtml.Append("<li>");
                this.strHtml.Append("<div><span style='color:red;'>暂无数据</span></div>");
                this.strHtml.Append("</li>");
                this.strHtml.Append("</ul>");
            }
        }
Example #17
0
        private void DataBindGrid()
        {
            int              count       = 0;
            StringBuilder    strSql      = new StringBuilder("SELECT Recyclebin_ID,Recyclebin_EventField,Recyclebin_Name,CreateUserName,CreateDate,Recyclebin_Remark FROM Base_Recyclebin WHERE 1=1");
            IList <SqlParam> IList_param = new List <SqlParam>();

            if (this.BeginBuilTime.Value != "" || this.endBuilTime.Value != "")
            {
                strSql.Append(" and CreateDate >= @BeginBuilTime");
                strSql.Append(" and CreateDate <= @endBuilTime");
                IList_param.Add(new SqlParam("@BeginBuilTime", CommonHelper.GetDateTime(this.BeginBuilTime.Value)));
                IList_param.Add(new SqlParam("@endBuilTime", CommonHelper.GetDateTime(this.endBuilTime.Value).AddDays(1.0)));
            }
            strSql.Append(" and CreateUserId = @CreateUserId");
            IList_param.Add(new SqlParam("@CreateUserId", RequestSession.GetSessionUser().UserId));
            strSql.Append(" and Recyclebin_Name = @Recyclebin_Name");
            IList_param.Add(new SqlParam("@Recyclebin_Name", this._Recyclebin_Name));
            DataTable dt = DataFactory.SqlDataBase().GetPageList(strSql.ToString(), IList_param.ToArray <SqlParam>(), "CreateDate", "Desc", this.PageControl1.PageIndex, this.PageControl1.PageSize, ref count);

            ControlBindHelper.BindRepeaterList(dt, this.rp_Item);
            this.PageControl1.RecordCount = Convert.ToInt32(count);
        }
Example #18
0
        public void ProcessRequest(HttpContext context)
        {
            if (RequestSession.GetSessionUser() == null)
            {
                context.Response.Write("");
                context.Response.End();
            }

            context.Response.ContentType     = "text/plain";
            context.Response.Buffer          = true;
            context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1.0);
            context.Response.AddHeader("pragma", "no-cache");
            context.Response.AddHeader("cache-control", "");
            context.Response.CacheControl = "no-cache";
            string TableName  = context.Request["T"];
            string TableField = context.Request["F"];
            string UserName   = context.Request["U"];
            string Sinput     = context.Request["P"];

            DFsystemDal DF  = new DFsystemDal();
            var         res = "";

            if (!string.IsNullOrEmpty(TableName) && !string.IsNullOrEmpty(TableField))
            {
                ResTableField s = new ResTableField();
                if (!string.IsNullOrEmpty(UserName))
                {
                    string userid = RequestSession.GetSessionUser().UserId.ToString();
                    res = JsonTool.Serialize <ResTableField>(DF.GetInputMatch(TableName, TableField, userid, Sinput));
                }
                else
                {
                    res = JsonTool.Serialize <ResTableField>(DF.GetInputMatch(TableName, TableField, Sinput));
                }
            }

            context.Response.Write(res);
            context.Response.End();
        }
Example #19
0
        protected void Save_Click(object sender, EventArgs e)
        {
            Hashtable ht = new Hashtable();

            ht = ControlBindHelper.GetWebControls(this.Page);
            ht["Property_Control_ID"] = 0;
            if (!string.IsNullOrEmpty(this._key))
            {
                ht["ModifyDate"]   = DateTime.Now;
                ht["ModifyUserId"] =

                    RequestSession.GetSessionUser().UserId;
                ht["ModifyUserName"] =

                    RequestSession.GetSessionUser().UserName;
            }
            else
            {
                ht["Property_ID"]  = CommonHelper.GetGuid;
                ht["CreateUserId"] =

                    RequestSession.GetSessionUser().UserId;
                ht["CreateUserName"] =

                    RequestSession.GetSessionUser().UserName;
            }
            bool IsOk = DataFactory.SqlDataBase

                            ().Submit_AddOrEdit("Base_AppendProperty", "Property_ID", this._key, ht);

            if (IsOk)
            {
                ShowMsgHelper.AlertMsg("操作成功!");
            }
            else
            {
                ShowMsgHelper.Alert_Error("操作失败!");
            }
        }
Example #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string AdminHotelid = hdAdminHotelid.Value = RequestSession.GetSessionUser().AdminHotelid.ToString();
            //tab4
            StringBuilder sql = new StringBuilder();

            sql.AppendFormat("SELECT Wx_Menu FROM Wx_function WHERE AdminHotelid='{0}' ", AdminHotelid);
            DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sql);

            if (dt != null && dt.Rows.Count > 0)
            {
                //公众号底部菜单权限
                if (dt.Rows[0][0].ToString() != "1")
                {
                    tab4.Visible = false;
                }
                else
                {
                    tab4.Visible = true;
                }
            }
        }
Example #21
0
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                Hashtable ht = new Hashtable();

                // 条目名称
                ht["Name"] = this.txtName.Text.Trim();
                // 设置的值
                if (this.PanelTxt.Visible)
                {
                    ht["SettingContent"] = this.txtSettingContent.Text.Trim();
                }
                else if (this.PanelImg.Visible)
                {
                    ht["SettingContent"] = this.hidPath.Value;
                }
                //说明
                ht["Description"] = this.txtDescription.Text.Trim();
                ht["SettingType"] = this.drpDic.SelectedValue.ToString();
                Hashtable htSetting = sysSetingManager.GetSettingByID(_key);
                bool      result    = sysSetingManager.AddOrEdit(ht, _key);
                if (result)
                {
                    Logger.Info("系统参数配置," + RequestSession.GetSessionUser().UserName + "将【" + htSetting["NAME"].ToString() + "--" + htSetting["SETTINGCONTENT"].ToString() + "】,修改为【" + ht["Name"].ToString() + "--" + ht["SettingContent"].ToString() + "】");
                    ShowMsgHelper.AlertMsgNoFresh("操作成功!");
                }
                else
                {
                    ShowMsgHelper.Alert_Error("操作失败!");
                }
            }
            catch (Exception ex)
            {
                Logger.Error("系统参数配置:" + ex.Message.ToString());
                throw ex;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     _key        = Request["key"];
     txt_EmpID   = RequestSession.GetSessionUser().UserId.ToString();
     txt_EmpName = RequestSession.GetSessionUser().UserName.ToString();
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(_key))
         {
             string        sql    = "select ApprovalFlag,FilesAdd from Base_PerTravelApply where id='" + _key + "'";
             StringBuilder sb_sql = new StringBuilder(sql);
             DataTable     dt     = DataFactory.SqlDataBase().GetDataTableBySQL(sb_sql);
             if (dt.Rows[0].ItemArray[0] != null)
             {
                 int_AppFlag = int.Parse(dt.Rows[0].ItemArray[0].ToString());
                 InitData();
                 if (int_AppFlag != 0 && int_AppFlag != 3)
                 {
                     Save.Visible = false;
                     ShowMsgHelper.Alert_Error("申请已在审批中或已审批完成,不得被修改!");
                 }
                 if (dt.Rows[0].ItemArray[1] == null || dt.Rows[0].ItemArray[1].ToString().Length == 0)
                 {
                     DownFiles.Visible = false;
                 }
                 else
                 {
                     DownFiles.Visible = true;
                     txt_downFilesAdd  = dt.Rows[0].ItemArray[1].ToString();
                 }
             }
             else
             {
                 ShowMsgHelper.Alert_Error("数据错误,请联系管理员");
             }
         }
     }
 }
Example #23
0
        public void updates(HttpContext context)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("delete jfmatter WHERE AdminHotelid='" + RequestSession.GetSessionUser().AdminHotelid + "' ");
            DataFactory.SqlDataBase().ExecuteBySql(sql);
            string value    = context.Request["values"].Trim();
            string isEnble  = context.Request["isEnble"].Trim();
            string isEnble1 = context.Request["isEnble1"].Trim();
            string isEnble2 = context.Request["isEnble2"].Trim();
            string isEnble3 = context.Request["isEnble3"].Trim();

            string isjf = context.Request["isjf"].Trim();
            int    x    = 0;

            string[] values = value.Split('|');
            for (int i = 0; i < values.Length; i++)
            {
                Hashtable ht = new Hashtable();
                ht["jb"]     = values[i].Split(',')[0];
                ht["jfzhi"]  = values[0].Split(',')[1];
                ht["jfzhi1"] = values[i].Split(',')[2];
                ht["jfzhi2"] = values[i].Split(',')[3];
                ht["jfzhi3"] = values[i].Split(',')[4];

                ht["isEnble"]  = isEnble;
                ht["isEnble1"] = isEnble1;
                ht["isEnble2"] = isEnble2;
                ht["isEnble3"] = isEnble3;

                ht["isjf"]         = isjf;
                ht["AdminHotelid"] = RequestSession.GetSessionUser().AdminHotelid.ToString();

                x += DataFactory.SqlDataBase().InsertByHashtable("jfmatter", ht);
            }

            context.Response.Write(x);
        }
Example #24
0
        public string AddSourceMaterial(HttpContext context)
        {
            string strResult = "";
            string title     = context.Request["Title"];

            try
            {
                var user = RequestSession.GetSessionUser();
                if (user != null)
                {
                    using (var db = new UdowsYunPublicEntities())
                    {
                        int?started = db.Company.Find(user.CompanyId)?.stateId;
                        if (started == null || started != 2)
                        {
                            return("{ \"result\": false,\"msg\": \"审核没有通过!\"}");
                        }
                        Material mi = new Material
                        {
                            companyId    = user.CompanyId,
                            creatname    = user.username,
                            IsDelete     = 0,
                            title        = title,
                            C__creattime = DateTimeHelper.ConvertDateTimeInt(DateTime.Now)
                        };
                        db.Material.Add(mi);
                        db.SaveChanges();
                        strResult = "{ \"result\": true,\"id\":" + mi.id + ",\"msg\":\"添加成功!\"}";
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
            return(strResult);
        }
Example #25
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Save_Click(object sender, EventArgs e)
        {
            Hashtable ht = new Hashtable();

            ht = ControlBindHelper.GetWebControls(this.Page);
            if (ParentId.Value == "")
            {
                ht["ParentId"]  = "0";
                ht["Menu_Type"] = 1;
            }
            else
            {
                ht["Menu_Type"] = 2;
            }
            if (!string.IsNullOrEmpty(_key))
            {
                ht["ModifyDate"]     = DateTime.Now;
                ht["ModifyUserId"]   = RequestSession.GetSessionUser().UserId;
                ht["ModifyUserName"] = RequestSession.GetSessionUser().UserName;
            }
            else
            {
                ht["Menu_Id"]        = CommonHelper.GetGuid;
                ht["CreateUserId"]   = RequestSession.GetSessionUser().UserId;
                ht["CreateUserName"] = RequestSession.GetSessionUser().UserName;
            }
            bool IsOk = DataFactory.SqlDataBase().Submit_AddOrEdit("Base_SysMenu", "Menu_Id", _key, ht);

            if (IsOk)
            {
                CacheHelper.RemoveAllCache();
                ShowMsgHelper.AlertMsg("Success!");
            }
            else
            {
                ShowMsgHelper.Alert_Error("Error!");
            }
        }
Example #26
0
        public string ImageRequest(HttpContext context)
        {
            string        strResult = "";
            string        img       = "";
            List <object> list      = new List <object>();
            var           user      = RequestSession.GetSessionUser();

            if (user != null)
            {
                string goodspath = ConfigurationManager.AppSettings["ImgUmasMapSrc"] + user.CompanyId;
                if (!Directory.Exists(goodspath))
                {
                    Directory.CreateDirectory(goodspath);
                }
                list = JsonConvert.DeserializeObject <List <object> >(context.Request["images"]);
                for (int i = 0; i < list.Count; i++)
                {
                    var           postedFile = list[i].ToString();
                    string        imgpoth    = Uploads(postedFile);
                    ApiSoapClient a          = new ApiSoapClient();
                    string        json       = a.UploadInfoImg(Convert.ToInt32(user.CompanyId), ImgaeFoByte(imgpoth));
                    ImgTag        it         = JsonConvert.DeserializeObject <ImgTag>(json);
                    if (it != null)
                    {
                        if (it.result == 1)
                        {
                            img += it.name + ",";
                        }
                    }
                }
                strResult = img.Substring(0, img.Length - 1);
            }
            else
            {
                strResult = "";
            }
            return(strResult);
        }
Example #27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         hdAdminHotelid.Value = RequestSession.GetSessionUser().AdminHotelid.ToString();
         StringBuilder sb = new StringBuilder();
         sb.Append(@"
         SELECT  *  FROM    ReceiptRules 
         WHERE   AdminHotelid =@AdminHotelid 
         ");
         SqlParam[] param = new SqlParam[] {
             new SqlParam("@AdminHotelid", hdAdminHotelid.Value)
         };
         DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sb, param);
         if (dt != null && dt.Rows.Count > 0)
         {
             if (dt.Rows[0]["RulesContent"] != null && dt.Rows[0]["RulesContent"].ToString() != "")
             {
                 txtRulesContent.Value = dt.Rows[0]["RulesContent"].ToString();
             }
         }
     }
 }
Example #28
0
 public virtual void ProcessRequest(HttpContext context)
 {
     if (RequestSession.GetSessionUser() == null)
     {
         string action = context.Request["action"];
         //判断一些请求不做非登录状态下跳转
         if (action != null)
         {
             if (action.ToLower() != "login")
             {
                 context.Session.Abandon();  //取消当前会话
                 context.Session.Clear();
                 context.Response.Redirect("~/Frame/Login.htm");
             }
         }
         else
         {
             context.Session.Abandon();  //取消当前会话
             context.Session.Clear();
             context.Response.Redirect("~/Frame/Login.htm");
         }
     }
 }
Example #29
0
        /// <summary>
        /// 子功能项
        /// </summary>
        /// <param name="ParentId">上级菜单主键</param>
        /// <returns></returns>
        public string Submenu(string ParentId)
        {
            StringBuilder sb_Submenu = new StringBuilder();
            string        UserId     = RequestSession.GetSessionUser().UserId;

            IList shortcut = bpms_shortcutibll.GetList(UserId);

            IList list = bpms_permissionibll.GetModulePermission(UserId);
            List <BPMS_ModulePermission> itemNode = IListHelper.IListToList <BPMS_ModulePermission>(list).FindAll(t => t.ParentId == ParentId);

            foreach (BPMS_ModulePermission entity in itemNode)
            {
                List <BPMS_ModulePermission> Isshortcut = IListHelper.IListToList <BPMS_ModulePermission>(shortcut).FindAll(t => t.MenuId == entity.MenuId);
                if (Isshortcut.Count == 0)
                {
                    sb_Submenu.Append("<div onclick=\"AddMenu('" + entity.MenuId + "')\" " + entity.Description + " class=\"shortcuticons\">");
                    sb_Submenu.Append("<img src=\"/Themes/Images/32/" + entity.Img + "\" alt=\"\" /><br />");
                    sb_Submenu.Append("" + entity.FullName + "");
                    sb_Submenu.Append("</div>");
                }
            }
            return(sb_Submenu.ToString());;
        }
Example #30
0
        /// <summary>
        ///获取酒店微商城图片
        /// </summary>
        /// <param name="context"></param>
        private void GetMallPicList(HttpContext context)
        {
            string    HotelId      = context.Request["HotelId"];
            string    AdminHotelid = RequestSession.GetSessionUser().AdminHotelid.ToString();
            JsonData  jsondata     = new JsonData();
            string    sql          = string.Format(@"select ID, ImgFile from Photo where PID='{0}' and [type]='{1}' and AdminHotelid='{2}' order by ID asc", HotelId, (int)DefaultFilePath.SystemType.Mall, AdminHotelid);
            DataTable ds           = DataFactory.SqlDataBase().GetDataTableBySQL(new StringBuilder(sql));

            if (ds != null && ds.Rows.Count > 0)
            {
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    JsonData json1 = new JsonData();
                    json1["ID"]      = ds.Rows[i]["ID"].ToString();
                    json1["IMGFILE"] = ds.Rows[i]["ImgFile"].ToString();
                    jsondata.Add(json1);
                }
            }
            string json = "";

            json = jsondata.ToJson();
            context.Response.Write(json);
        }
Example #31
0
        protected void lbtDefault_Click(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("UPDATE Base_UserInfo SET IsDefault = 1 WHERE User_Account = @User_Account AND User_Pwd = @User_Pwd");
            SqlParam[] param = new SqlParam[] {
                new SqlParam("@User_Account", RequestSession.GetSessionUser().UserAccount),
                new SqlParam("@User_Pwd", RequestSession.GetSessionUser().UserPwd)
            };

            object obj = DataFactory.SqlDataBase().GetObjectValue(sb, param);


            sb = new StringBuilder();
            sb.Append("UPDATE Base_UserInfo SET IsDefault = 0 WHERE USER_ID = @USER_ID");
            param = new SqlParam[] {
                new SqlParam("@USER_ID", hdUserId.Value)
            };

            obj = DataFactory.SqlDataBase().GetObjectValue(sb, param);

            Bind();
        }
        public RequestSession Login(WebProxy proxy = null)
        {
            string address = proxy != null ? proxy.Address.ToString() : "";
            Console.WriteLine("登出LinkedIn...Proxy: {0}", address);
            var session = new RequestSession(this);
            string result;

            HttpRequestContext requestContext = new HttpRequestContext(this.LinkedInWebSystemConfig.MainEntryUrl)
            {
                Referer = LinkedInWebSystemConfig.MainEntryUrl,
                KeepAlive = true,
                TimeOut = 10000
            };
            HttpRequestUtils.RequestHtmlPage(requestContext, out result, proxy);
            session.CookieContainer = requestContext.CookieContainer;

            result = string.Empty;
            HttpRequestContext loginRequestContext = new HttpRequestContext(this.LinkedInWebSystemConfig.LoginUrl)
            {
                Referer = LinkedInWebSystemConfig.MainEntryUrl,
                KeepAlive = true,
                TimeOut = 10000
            };
            HttpRequestUtils.RequestHtmlPage(loginRequestContext, out result, proxy);
            session.CookieContainer = loginRequestContext.CookieContainer;

            string csrfToken = string.Empty;
            string sourceAlias = string.Empty;

            csrfToken = this.GetCSRFToken(result);
            sourceAlias = this.GetSourceAlias(result);

            // string viewStateValue = string.Empty;
            //viewStateValue = this.GetViewState(result);

            Console.WriteLine("登录LinkedIn...Proxy: {0}", address);
            string postData = String.Format(this.LinkedInWebSystemConfig.LoginPostDataFormat,
                                            HttpUtility.UrlEncode(this.LinkedInWebSystemConfig.LoginParameters["UserName"].Value),
                                            HttpUtility.UrlEncode(this.LinkedInWebSystemConfig.LoginParameters["Password"].Value),
                                            csrfToken,
                                            sourceAlias);
            HttpPostRequestContext postRequestContext = new HttpPostRequestContext(this.LinkedInWebSystemConfig.LoginSubmitUrl, postData)
            {
                CookieContainer = session.CookieContainer,
                Referer = LinkedInWebSystemConfig.MainEntryUrl,
                KeepAlive = true,
                TimeOut = 2000
            };

            string loginResult;

            HttpRequestUtils.RequestPostHtmlPage(postRequestContext, out loginResult, proxy);
            Console.WriteLine("登录LinkedIn成功....Proxy: {0}", address);
            session.CookieContainer = postRequestContext.CookieContainer;
            return session;
        }
        private WebProxy CreateProxyInstance(int index, out RequestSession session)
        {
            if (this.ProxyConfiguration.ProxyCollection.Count <= index)
            {
                index = 0;
            }

            var currentProxyConfig = this.ProxyConfiguration.ProxyCollection[index];
            WebProxy proxy = new WebProxy(currentProxyConfig.Ip, Convert.ToInt32(currentProxyConfig.Port));
            if (currentProxyConfig.Session == null)
            {
                currentProxyConfig.Session = Login(proxy);
            }

            session = currentProxyConfig.Session;
            Console.WriteLine();
            return proxy;
        }
        private HttpRequestContext BuildHttpRequestContext(string postalCode, string rsid, string orid, RequestSession session)
        {
            string searchProfileUrl = String.Format(this.LinkedInWebSystemConfig.SearchProfileUrl,
                                                   System.Web.HttpUtility.UrlEncode(postalCode),
                                                   rsid,
                                                   orid);
            HttpRequestContext searchProfleRequestContext = new HttpRequestContext(searchProfileUrl)
            {
                CookieContainer = session.CookieContainer,
                Referer = LinkedInWebSystemConfig.MainEntryUrl,
                KeepAlive = true,
                TimeOut = 15000
            };

            return searchProfleRequestContext;
        }