protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Url != null)
        {
            FromURL = Request.Url.ToString();
        }
        sFileID = Request.QueryString["FileID"] == null ? "0" : Request.QueryString["FileID"].ToString();
        //User Right
        this.btnNew.Disabled   = CurrUser.userRole.Marketing.ToString().IndexOf("1") > -1 ? false : true;
        this.btnRemove.Enabled = CurrUser.userRole.Marketing.ToString().IndexOf("2") > -1 ? true : false;
        if (!IsPostBack)
        {
            BindFilterData();
            //BindContextMenu();
            BindGrid();
            this.hfFileID.Value = sFileID;

            LPWeb.BLL.Company_General bllcompanyGeneral = new Company_General();

            var modelCompanyGen = bllcompanyGeneral.GetModel();
            if (modelCompanyGen != null && (modelCompanyGen.EnableMarketing == false || modelCompanyGen.StartMarketingSync == false))
            {
                btnNew.Disabled = true;
                //btnNew.HRef = "javascript:;";
                btnNew.Attributes["onclick"] = "";
                btnNew.Attributes["style"]   = "";
            }
            else
            {
                btnNew.Disabled = false;
            }
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Url != null)
            {
                FromURL = Request.Url.ToString();
            }
            sFileID = Request.QueryString["FileID"] == null ? "0" : Request.QueryString["FileID"].ToString();

            //User Right
            this.lbtnAdd.Enabled   = CurrUser.userRole.Marketing.ToString().IndexOf("1") > -1 ? true : false;
            this.btnRemove.Enabled = CurrUser.userRole.Marketing.ToString().IndexOf("2") > -1 ? true : false;

            //Set add button enable status( If (Company_General.EnableMarketing= 0  || Company_General.StartMarketingSync=0), disable this button)
            BLL.Company_General   companyGeneral = new Company_General();
            Model.Company_General companyModel   = companyGeneral.GetModel();
            if (companyModel.EnableMarketing == false || companyModel.StartMarketingSync == false)
            {
                this.lbtnAdd.Enabled = false;
            }

            if (!IsPostBack)
            {
                BindFilterData();
                BindGrid();

                this.hfFileID.Value = sFileID;
            }
        }
Beispiel #3
0
    /// <summary>
    /// Gets the init data.
    /// </summary>
    private void GetInitData()
    {
        try
        {
            modCompanyGeneral = bllCompanyGeneral.GetModel();
        }
        catch (Exception exception)
        {
            LPLog.LogMessage(exception.Message);
        }

    }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Url != null)
            {
                FromURL = Request.Url.ToString();
            }

            //sContactID = Request.QueryString["ContactID"] == null ? "0" : Request.QueryString["ContactID"].ToString();
            #region CR48

            if (Request.QueryString["FileID"] == null)
            {
                sContactID = "0";
            }
            else
            {
                var             sFileId  = Request.QueryString["FileID"].ToString();
                LPWeb.BLL.Loans bllLoans = new Loans();
                sContactID = bllLoans.GetBorrowerID(Convert.ToInt32(sFileId)).Value.ToString();
            }
            #endregion



            //User Right
            this.btnNew.Disabled   = CurrUser.userRole.Marketing.ToString().IndexOf("1") > -1 ? false : true;
            this.btnRemove.Enabled = CurrUser.userRole.Marketing.ToString().IndexOf("2") > -1 ? true : false;
            //Set add button enable status( If (Company_General.EnableMarketing= 0  || Company_General.StartMarketingSync=0), disable this button)
            BLL.Company_General   companyGeneral = new Company_General();
            Model.Company_General companyModel   = companyGeneral.GetModel();
            if (companyModel.EnableMarketing == false || companyModel.StartMarketingSync == false)
            {
                this.btnNew.Disabled      = true;
                this.hdnCreateNotes.Value = "0";
            }

            if (!IsPostBack)
            {
                BindFilterData();
                BindContextMenu();
                BindGrid();
            }
        }
Beispiel #5
0
    private string GetCompanyName()
    {
        string          CompanyName = string.Empty;
        Company_General cg          = new Company_General();
        DataSet         ds          = new DataSet();

        try
        {
            ds = cg.GetList(1, "", "1");
            if (ds == null || ds.Tables.Count < 1 || ds.Tables[0].Rows.Count < 1)
            {
            }
            else
            {
                CompanyName = ds.Tables[0].Rows[0]["Name"].ToString();
            }
        }
        catch
        { }

        return(CompanyName);
    }
Beispiel #6
0
    /// <summary>
    /// Gets the data from UI.
    /// </summary>
    private void GetDataFromUI()
    {
        //get existing record
        GetInitData();
        if (modCompanyGeneral == null)
        {
            modCompanyGeneral = new Company_General();
            isNew = true;
        }

        string ADOUFilterName = txtADOUFilterName.Text.Trim();
        if (!string.IsNullOrEmpty(ADOUFilterName))
        {
            modCompanyGeneral.AD_OU_Filter = ADOUFilterName;
        }

        string companyName = txtCompanyName.Text.Trim();
        if (!string.IsNullOrEmpty(companyName))
        {
            modCompanyGeneral.Name = companyName;
        }
        else
        {
            //todo:display message
            PageCommon.WriteJsEnd(this, "Company Name can not be empty.", PageCommon.Js_RefreshSelf);
            return;
        }

        string description = txtDescription.Text.Trim();
        if (!string.IsNullOrEmpty(description))
        {
            modCompanyGeneral.Desc = description;
        }

        string address = txtAddress.Text.Trim();
        if (!string.IsNullOrEmpty(address))
        {
            modCompanyGeneral.Address = address;
        }

        string city = txtCity.Text.Trim();
        if (!string.IsNullOrEmpty(city))
        {
            modCompanyGeneral.City = city;
        }

        string state = ddlState.SelectedValue;
        if (!string.IsNullOrEmpty(state))
        {
            modCompanyGeneral.State = state;
        }

        string zip = txtZip.Text.Trim();
        if (!string.IsNullOrEmpty(zip))
        {
            modCompanyGeneral.Zip = zip;
        }
        string interval = ddlInterval.SelectedValue;
        if (!string.IsNullOrEmpty(interval))
        {
            modCompanyGeneral.ImportUserInterval = interval.Parse<int>();
        }

        string phone = txtPhone.Text.Trim();
        if (!string.IsNullOrEmpty(phone))
        {
            modCompanyGeneral.Phone = phone;
        }

        string fax = txtFax.Text.Trim();
        if(!string.IsNullOrEmpty(fax))
        {
            modCompanyGeneral.Fax = fax;
        }

        string email = txtEmail.Text.Trim();
        if (!string.IsNullOrEmpty(email))
        {
            modCompanyGeneral.Email = email;
        }

        string weburl = txtWebURL.Text.Trim();
        if (!string.IsNullOrEmpty(weburl))
        {
            modCompanyGeneral.WebURL = weburl;
        }

        string strSecToken = this.txtSecToken.Text.Trim();
        if (string.IsNullOrEmpty(strSecToken))
            strSecToken = Guid.NewGuid().ToString();
        modCompanyGeneral.GlobalId = strSecToken;

        string sMyEmailInboxURL = this.txtMyEmailInboxUrl.Text.Trim();
        modCompanyGeneral.MyEmailInboxURL = sMyEmailInboxURL;

        string sMyCalendarURL = this.txtMyCalendarURL.Text.Trim();
        modCompanyGeneral.MyCalendarURL = sMyCalendarURL;

        string sRatesURL = this.txtRatesURL.Text.Trim();
        modCompanyGeneral.RatesURL = sRatesURL;
    }
Beispiel #7
0
    /// <summary>
    /// Gets the data from UI.
    /// </summary>
    private void GetDataFromUI()
    {
        //get existing record
        GetInitData();
        if (modCompanyPoint == null)
        {
            modCompanyPoint = new Company_Point();
            isNew           = true;
        }

        if (modCompayGeneral == null)
        {
            modCompayGeneral = new Company_General();
            isGeneralNew     = true;
        }


        string iniPath = txtWinpointPath.Text;

        if (!string.IsNullOrEmpty(iniPath))
        {
            modCompanyPoint.WinpointIniPath = iniPath.GetFilePath();
        }

        //string fieldIdMappingFile = txtPointFieldIDMappingFile.Text;
        //if (!string.IsNullOrEmpty(fieldIdMappingFile))
        //{
        //    modCompanyPoint.PointFieldIDMappingFile = fieldIdMappingFile.GetFilePath();
        //}

        string cardexFile = txtCardexFile.Text;

        if (!string.IsNullOrEmpty(cardexFile))
        {
            modCompanyPoint.CardexFile = cardexFile.GetFilePath();
        }

        string impInterval = ddlPointImportInterval.SelectedValue;

        if (!string.IsNullOrEmpty(impInterval))
        {
            modCompanyPoint.PointImportIntervalMinutes = impInterval.Parse <int>();
        }

        string masterSource = ddlMasterSource.SelectedValue.Trim();

        if (!string.IsNullOrEmpty(masterSource))
        {
            modCompanyPoint.MasterSource = masterSource;
        }
        else
        {
            modCompanyPoint.MasterSource = "Point";
        }

        modCompayGeneral.ActiveLoanWorkflow = ckActiveLoanWorkflow.Checked;
        modCompanyPoint.Auto_ConvertLead    = ckAutoConvertLead.Checked;

        //CR60 ADD
        modCompanyPoint.Enable_MultiBranchFolders = ckEnableMultibranchfolders.Checked;
    }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //LoginUser loginUser = new LoginUser();
                //loginUser.ValidatePageVisitPermission("BranchSetup");
                //权限验证
                var loginUser = new LoginUser();
                if (!loginUser.userRole.CompanySetup)
                {
                    Response.Redirect("../Unauthorize.aspx");
                    return;
                }
            }
            catch (Exception exception)
            {
                LPLog.LogMessage(exception.Message);
            }
            if (!IsPostBack)
            {
                if (ddlState.Items.Count <= 0)
                {
                    USStates.Init(ddlState);
                }
                BindBranchNames();
                LPWeb.BLL.Company_General cG = new Company_General();
                this.hdnMarketingEnabled.Value = "0";
                if (cG.CheckMarketingEnabled())
                {
                    this.hdnMarketingEnabled.Value = "1";
                }
                string sErrorMsg   = "Failed to load current page: invalid GroupID.";
                string sReturnPage = "BranchSetup.aspx";

                if (this.Request.QueryString["BranchID"] != null) // 如果有GroupID
                {
                    string sBranchID = this.Request.QueryString["BranchID"].ToString();
                    if (PageCommon.IsID(sBranchID) == false)
                    {
                        PageCommon.WriteJsEnd(this, sErrorMsg, "window.location.href='" + sReturnPage + "'");
                    }

                    this.iBranchID = Convert.ToInt32(sBranchID);
                }
                else // 如果没有BranchID,初始化时
                {
                    // 取第一个BranchID的ID
                    if (ddlBranchName.Items.Count > 0)
                    {
                        this.iBranchID = Convert.ToInt32(ddlBranchName.Items[0].Value);
                    }
                }
                if (!branchManager.ExistBranch(iBranchID))
                {
                    return;
                }
                ViewState["branchid"]            = iBranchID.ToString();
                this.ddlBranchName.SelectedValue = iBranchID.ToString();
                LoadControls();
            }

            iBranchID = int.Parse(ViewState["branchid"].ToString());
        }