Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var type  = new SysSettingBLL().GetValueById(SysSettingEnum.CRM_OPPORTUNITY_LOSS_REASON);
            int value = 0;

            if (!int.TryParse(type, out value))
            {
                needReasonType = DicEnum.SYS_CLOSE_OPPORTUNITY.NEED_NONE;
            }
            else
            {
                needReasonType = (DicEnum.SYS_CLOSE_OPPORTUNITY)value;
            }

            if (needReasonType != DicEnum.SYS_CLOSE_OPPORTUNITY.NEED_NONE)
            {
                var list = new GeneralBLL().GetDicValues(GeneralTableEnum.OPPORTUNITY_LOSS_REASON_TYPE);
                LossReasonList.DataTextField  = "show";
                LossReasonList.DataValueField = "val";
                LossReasonList.DataSource     = list;
                LossReasonList.DataBind();
                LossReasonList.Items.Insert(0, new ListItem()
                {
                    Value = "", Text = "   ", Selected = true
                });
            }

            if (IsPostBack)
            {
                if (needReasonType == DicEnum.SYS_CLOSE_OPPORTUNITY.NEED_TYPE_DETAIL)
                {
                    lossReason = DNRequest.GetQueryStringValue("LossReasonDetail", "");
                }
            }
        }
Exemplo n.º 2
0
        protected string isCheck      = ""; // 用于检测是否显示checkBox框
        protected void Page_Load(object sender, EventArgs e)

        {
            var bll = new BLL.QueryCommonBLL();

            catId = DNRequest.GetQueryInt("cat", 0);
            // catId = (int)DicEnum.QUERY_CATE.PROJECT_SEARCH;
            int typeId = DNRequest.GetQueryInt("type", 0);
            // typeId = (int)QueryType.PROJECT_SEARCH;
            int groupId = DNRequest.GetQueryInt("group", 0);

            // groupId = 108;
            isCheck = DNRequest.GetStringValue("isCheck", "");
            if (catId == 0)
            {
                Response.Close();
                return;
            }

            if (typeId == 0 || groupId == 0)
            {
                var info = bll.GetQueryGroup(catId);
                if (info == null || info.Count == 0)
                {
                    Response.Close();
                    return;
                }
                queryTypeId = info[0].query_type_id;
                paraGroupId = info[0].id;
            }
            else
            {
                queryTypeId = typeId;
                paraGroupId = groupId;
            }

            var condition = bll.GetConditionParaVisiable(GetLoginUserId(), paraGroupId);

            if (condition.Count == 0)
            {
                conditionHeight = 0;
            }
            else
            {
                int rowCnt = condition.Count / 3;
                if (condition.Count % 3 != 0)
                {
                    rowCnt++;
                }
                conditionHeight = 125 + rowCnt * 35;
                if (conditionHeight < 206)
                {
                    conditionHeight = 206;
                }
                if (conditionHeight > 370)
                {
                    conditionHeight = 370;
                }
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string _action = DNRequest.GetQueryString("action");

            if ("Logout".Equals(_action))
            {
                EMT.Tools.Common.WriteCookie("Token", "DoneNOW", -14400);
                //Session["dn_session_user_info"] = null;
                //EMT.Tools.Common.WriteCookie("UserName", "DoneNOW", -14400);
                //EMT.Tools.Common.WriteCookie("UserPwd", "DoneNOW", -14400);
                Response.Redirect("Login.aspx");
            }
        }
Exemplo n.º 4
0
        public override void AjaxProcess(HttpContext context)
        {
            string action = DNRequest.GetQueryString("act");

            switch (action)
            {
            case "status":
                var soid   = context.Request.QueryString["id"];
                var status = context.Request.QueryString["status_id"];
                ChangeSaleOrderStatus(context, long.Parse(soid), int.Parse(status));
                break;

            case "DeleteQuota":
                DeleteQuota(context);
                break;

            default:
                context.Response.Write("{\"code\": 1, \"msg\": \"参数错误!\"}");
                return;
            }
        }
Exemplo n.º 5
0
        protected void Finish_Click(object sender, EventArgs e)
        {
            long quoteId = DNRequest.GetQueryLong("id", 0);

            if (quoteId == 0)
            {
                Response.Write("<script>alert('请求错误!');window.close();</script>");
                return;
            }

            int reasonType = 0;

            lossReason = DNRequest.GetFormString("LossReasonDetail");
            if (needReasonType != DicEnum.SYS_CLOSE_OPPORTUNITY.NEED_NONE)
            {
                if (DNRequest.GetFormString("LossReasonList") == "")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('请选择丢失商机原因!');</script>");
                    return;
                }
                int.TryParse(DNRequest.GetFormString("LossReasonList"), out reasonType);
            }
            if (needReasonType == DicEnum.SYS_CLOSE_OPPORTUNITY.NEED_TYPE_DETAIL)
            {
                if (lossReason == "")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('请输入丢失商机原因详情!');</script>");
                    return;
                }
            }

            var rslt = new QuoteBLL().LossQuote(GetLoginUserId(), quoteId, reasonType, lossReason);

            if (!string.IsNullOrEmpty(rslt))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "提示信息", $"<script>alert('{rslt}');</script>");
                return;
            }
            Response.Write("<script>window.close();self.opener.location.reload();</script>");
        }
Exemplo n.º 6
0
        public override void AjaxProcess(HttpContext context)
        {
            string action = DNRequest.GetQueryString("act");

            switch (action)
            {
            case "country":     //国家
                GetCountryList(context);
                break;

            case "province":     //省
                GetProviceList(context);
                break;

            case "district":     //行政区
                GetDistrictList(context);
                break;

            case "delete":
                string location_id = DNRequest.GetQueryString("LocationId");
                context.Response.Write(DeleteLocation(context, Convert.ToInt64(location_id)));
                break;

            case "location":
                var locaId = context.Request.QueryString["location_id"];
                GetLocation(context, long.Parse(locaId));
                break;

            case "DeleteOrganization":
                DeleteOrganization(context);
                break;

            default:
                context.Response.Write("{\"code\": 1, \"msg\": \"参数错误!\"}");
                return;
            }
        }
Exemplo n.º 7
0
        // 点击登录
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string userName = uname.Text.Trim();
            string userPwd  = pswd.Text.Trim();
            string pwdMd5   = new Cryptographys().MD5Encrypt(userPwd);

            string ip    = DNRequest.GetIP();
            string agent = HttpContext.Current.Request.UserAgent;
            var    bll   = new AuthBLL();

            TokenDto token  = new TokenDto();
            var      result = bll.Login(userName, userPwd, agent, ip, out token);

            if (result == ERROR_CODE.SUCCESS)
            {
                Common.WriteCookie("Token", "DoneNOW", token.token);
                Application["isFromLogin"] = "******";
                Response.Redirect("index.aspx");
            }
            else
            {
                if (result == ERROR_CODE.PARAMS_ERROR)
                {
                    msgtip.InnerHtml = "请使用邮箱或手机号登录!";
                }
                if (result == ERROR_CODE.PASSWORD_ERROR)
                {
                    msgtip.InnerHtml = "密码错误!";
                }
                if (result == ERROR_CODE.USER_NOT_FIND)
                {
                    msgtip.InnerHtml = "输入用户不存在!";
                }
                if (result == ERROR_CODE.LOCK)
                {
                    msgtip.InnerHtml = "您的账户已被锁定,登录失败";
                }
                msgtip.Visible = true;
            }

            /*
             * var result = bll.Login(userName, userPwd, ip, agent, out user);
             * if (result== DTO.ERROR_CODE.SUCCESS)
             * {
             *  Session["dn_session_user_info"] = user;
             *  Session["dn_session_user_permits"] = bll.GetUserPermit(user.id);
             *  EMT.Tools.Common.WriteCookie("UserName", "DoneNOW", userName);
             *  EMT.Tools.Common.WriteCookie("UserPwd", "DoneNOW", pwdMd5);
             *  Response.Redirect("index.aspx");
             * }
             * else
             * {
             *  if (result == ERROR_CODE.PARAMS_ERROR)
             *      msgtip.InnerHtml = "请使用邮箱或手机号登录!";
             *  if (result == ERROR_CODE.PASSWORD_ERROR)
             *      msgtip.InnerHtml = "密码错误!";
             *  if (result == ERROR_CODE.USER_NOT_FIND)
             *      msgtip.InnerHtml = "输入用户不存在!";
             *  msgtip.Visible = true;
             * }
             */
        }
Exemplo n.º 8
0
        public override void AjaxProcess(HttpContext context)
        {
            //context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            string act = DNRequest.GetQueryString("act");

            switch (act)
            {
            case "name":     // 代表用于校验用户的名称
                var companyName = context.Request.QueryString["companyName"];
                companyNameCheck(context, companyName);
                break;

            case "contact":                                                                 // 通过客户id去获取联系人列表
                var account_id          = context.Request.QueryString["account_id"];
                var isUserParentContact = context.Request.QueryString["userParentContact"]; //userParentContact
                GetCompanyContact(context, account_id, isUserParentContact);
                break;

            case "contactList":        // 通过客户id去获取联系人列表
                account_id = context.Request.QueryString["account_id"];
                GetCompanyContactList(context, account_id);
                break;

            case "companyPhone":
                var id = context.Request.QueryString["account_id"];
                GetCompanyPhone(context, id);
                break;

            case "opportunity":
                var opportunity_account_id = context.Request.QueryString["account_id"];
                GetOpportunity(context, opportunity_account_id);
                break;

            case "OpportunityList":
                account_id = context.Request.QueryString["account_id"];
                GetOpportunityList(context, account_id);
                break;

            case "property":
                var property_account_id = context.Request.QueryString["account_id"];
                var propertyName        = context.Request.QueryString["property"];
                GetCompanyProperty(context, property_account_id, propertyName);
                break;

            case "propertyJson":
                property_account_id = context.Request.QueryString["account_id"];
                propertyName        = context.Request.QueryString["property"];
                GetCompanyPropertyJson(context, property_account_id, propertyName);
                break;

            case "Location":
                var location_account_id = context.Request.QueryString["account_id"];
                GetCompanyDefaultLocation(context, location_account_id);
                break;

            case "names":
                var ids = context.Request.QueryString["ids"];
                GetCompanyNamesByIds(context, ids);
                break;

            case "vendorList":
                var product_id = context.Request.QueryString["product_id"];
                GetVendorsByProductId(context, long.Parse(product_id));
                break;

            case "AccReference":
                var ref_account_id = context.Request.QueryString["account_id"];
                GetAccountReference(context, long.Parse(ref_account_id));
                break;

            case "project":
                var pro_account_id = context.Request.QueryString["account_id"];
                GetAccountProject(context, long.Parse(pro_account_id));
                break;

            case "GetAccByRes":
                GetAccByRes(context, long.Parse(context.Request.QueryString["resource_id"]), context.Request.QueryString["showType"], !string.IsNullOrEmpty(context.Request.QueryString["isShowCom"]));
                break;

            case "GetAccAlert":
                GetAccAlert(context);
                break;

            case "GetAccDetail":
                GetAccDetail(context);
                break;

            case "GetAccountByIds":
                GetAccountByIds(context);
                break;

            case "GetPartnerInfo":
                GetPartnerInfo(context);
                break;

            default:
                context.Response.Write("{\"code\": 1, \"msg\": \"参数错误!\"}");
                return;
            }
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var bll = new BLL.QueryCommonBLL();

            catId = DNRequest.GetQueryInt("cat", 0);
            int typeId  = DNRequest.GetQueryInt("type", 0);
            int groupId = DNRequest.GetQueryInt("group", 0);

            isCheck = DNRequest.GetStringValue("isCheck", "");
            if (catId == 0)
            {
                Response.Close();
                return;
            }

            if (typeId == 0 || groupId == 0)
            {
                var info = bll.GetQueryGroup(catId);
                if (info == null || info.Count == 0)
                {
                    Response.Close();
                    return;
                }
                queryTypeId = info[0].query_type_id;
                paraGroupId = info[0].id;
            }
            else
            {
                queryTypeId = typeId;
                paraGroupId = groupId;
            }
            param1 = string.IsNullOrEmpty(Request.QueryString["param1"]) ? "" : Request.QueryString["param1"];
            param2 = string.IsNullOrEmpty(Request.QueryString["param2"]) ? "" : Request.QueryString["param2"];
            param3 = string.IsNullOrEmpty(Request.QueryString["param3"]) ? "" : Request.QueryString["param3"];
            param4 = string.IsNullOrEmpty(Request.QueryString["param4"]) ? "" : Request.QueryString["param4"];
            param5 = string.IsNullOrEmpty(Request.QueryString["param5"]) ? "" : Request.QueryString["param5"];
            param6 = string.IsNullOrEmpty(Request.QueryString["param6"]) ? "" : Request.QueryString["param6"];
            param7 = string.IsNullOrEmpty(Request.QueryString["param7"]) ? "" : Request.QueryString["param7"];
            if (Request.QueryString["isShow"] == "Search")
            {
                isShow = "";
            }
            var condition = bll.GetConditionParaVisiable(GetLoginUserId(), paraGroupId);

            if (condition.Count == 0)
            {
                conditionHeight = 0;
            }
            else
            {
                int rowCnt = condition.Count / 3;
                if (condition.Count % 3 != 0)
                {
                    rowCnt++;
                }
                conditionHeight = 125 + rowCnt * 35;
                if (conditionHeight < 206)
                {
                    conditionHeight = 206;
                }
                if (conditionHeight > 370)
                {
                    conditionHeight = 370;
                }
                if (catId == (int)DTO.DicEnum.QUERY_CATE.APPROVE_CHARGES || catId == (int)DTO.DicEnum.QUERY_CATE.APPROVE_EXPENSE || catId == (int)DTO.DicEnum.QUERY_CATE.APPROVE_LABOUR || catId == (int)DTO.DicEnum.QUERY_CATE.APPROVE_MILESTONES || catId == (int)DTO.DicEnum.QUERY_CATE.APPROVE_RECURRING_SERVICES || catId == (int)DTO.DicEnum.QUERY_CATE.APPROVE_SUBSCRIPTIONS)
                {
                    conditionHeight += 40;
                }
            }
        }