Beispiel #1
0
        /// <summary>
        /// Get Branch data
        /// </summary>
        /// <returns></returns>
        private DataTable GetBranchData(string sRegionID, string sDivisionID)
        {
            DataTable dtBranches;

            try
            {
                Branches branchManager = new Branches();;
                //Binding Branch
                string sCondition = " Enabled='true'";
                if (sRegionID != "" && sRegionID != "0")
                {
                    sCondition += " AND RegionID = " + sRegionID;
                }
                if (sDivisionID != "" && sDivisionID != "0")
                {
                    sCondition += " AND DivisionID = " + sDivisionID;
                }
                dtBranches = branchManager.GetList(sCondition).Tables[0];

                DataRow drNewBranches = dtBranches.NewRow();
                drNewBranches["BranchId"] = 0;
                drNewBranches["Name"]     = "All Branches";
                dtBranches.Rows.InsertAt(drNewBranches, 0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dtBranches);
        }
Beispiel #2
0
    private void BindSelectBranchs()
    {
        Branches branch = new Branches();

        try
        {
            string  strWhere = " (DivisionID is null) or (DivisionID = " + this.iDivisionID.ToString() + ")";
            DataSet ds       = branch.GetList(strWhere);
            if (ds == null || ds.Tables.Count < 1 || ds.Tables[0].Rows.Count < 1)
            {
                //ds = null;
            }
            gridBranchSelectionList.AutoGenerateColumns = false;
            gridBranchSelectionList.DataSource          = ds.Tables[0];
            gridBranchSelectionList.DataBind();
        }
        catch
        { }
    }
Beispiel #3
0
    private void BindBranchs(int divID)
    {
        Branches branch = new Branches();

        try
        {
            string  strWhere = " DivisionID = " + divID;
            DataSet ds       = branch.GetList(strWhere);
            if (ds == null || ds.Tables.Count < 1 || ds.Tables[0].Rows.Count < 1)
            {
                //ds=null;
            }
            gridBranchList.AutoGenerateColumns = false;
            gridBranchList.DataSource          = ds.Tables[0];
            gridBranchList.DataBind();
        }
        catch
        { }
    }
Beispiel #4
0
        private void FillBranch()
        {
            try
            {
                LPWeb.Model.Branches model = branchManager.GetModel(iBranchID);
                ddlBranchName.SelectedValue = iBranchID.ToString();
                ckbEnabled.Checked          = model.Enabled;

                if (model.GroupID.HasValue && ddlGroupAccess.Items.FindByValue(model.GroupID.Value.ToString()) != null)
                {
                    ddlGroupAccess.SelectedValue = model.GroupID.Value.ToString();//设置选中项
                }
                else
                {
                    ddlGroupAccess.SelectedValue = "0";
                }
                txbDescription.Text   = model.Desc;
                txbAddress.Text       = model.BranchAddress;
                txbCity.Text          = model.City;
                txbZip.Text           = model.Zip;
                ddlState.Text         = model.BranchState;
                txbPhone.Text         = model.Phone;
                txbFax.Text           = model.Fax;
                txbEmail.Text         = model.Email;
                txbWebURL.Text        = model.WebURL;
                chkHomeBranch.Checked = model.HomeBranch;
                chkHomeBranch.Attributes.Add("cid", "chkHomeBranch");
                chkHomeBranch.Attributes.Add("BranchID", model.BranchId.ToString());

                #region find HomeBranch = true  BranchId

                var homebranchId = 0;
                if (model.HomeBranch != true)
                {
                    var ds = branchManager.GetList(1, " HomeBranch = 1 ", "BranchId");

                    if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        homebranchId = Convert.ToInt32(ds.Tables[0].Rows[0]["BranchId"]);
                    }
                }
                else
                {
                    homebranchId = model.BranchId;
                }

                chkHomeBranch.Attributes.Add("HomeBranchID", homebranchId.ToString());

                #endregion

                if (model.WebsiteLogo == null)
                {
                    Image1.ImageUrl = "../images/YourLogo.jpg";
                }
                else if (model.WebsiteLogo.Length < 1)
                {
                    Image1.ImageUrl = "../images/YourLogo.jpg";
                }
                else
                {
                    Image1.ImageUrl = "BranchLogo.aspx?BranchID=" + iBranchID.ToString() + "&ss=" + DateTime.Now.Millisecond.ToString();
                }

                txbLicense1.Text   = model.License1;
                txbLicense2.Text   = model.License2;
                txbLicense3.Text   = model.License3;
                txbLicense4.Text   = model.License4;
                txbLicense5.Text   = model.License5;
                txbDisclaimer.Text = model.Disclaimer;
            }
            catch
            {
            }
        }
Beispiel #5
0
    public void BindData()
    {
        #region Local PointFile  ----pointFileInfo and  pointFolderInfo



        if (pointFileInfo != null)
        {
            txbLastSync.Text = pointFileInfo.LastImported == null ? "" : pointFileInfo.LastImported.Value.ToString("MM/dd/yyyy hh:mm tt");
            txbFilename.Text = pointFileInfo.Name;
        }

        if (pointFolderInfo == null || string.IsNullOrEmpty(pointFolderInfo.Path))
        {
            txbPath.Text = string.Empty;
        }
        else
        {
            txbPath.Text = pointFolderInfo.Path;
        }
        txbPath.Text += (pointFileInfo == null || string.IsNullOrEmpty(pointFileInfo.Name))?string.Empty :  pointFileInfo.Name;
        // pointFolderInfo.Name;

        txbPath.Enabled = false;
        #endregion

        #region Branch ----loanInfo.BranchID

        Branches bllBranches = new Branches();

        if (iBranchId > 0)
        {
            ddlBranch.DataSource = bllBranches.GetList(" BranchId = " + loanInfo.BranchID);
            ddlBranch.DataBind();
            if (ddlBranch.Items.Count > 0)
            {
                ddlBranch.SelectedIndex = 0;
            }
            ddlBranch.Enabled = false;
        }
        else
        {
            DataTable dt = new DataTable();
            if (loginUser.sRoleName == "Executive")
            {
                dt = bllBranches.GetBranchFilter_Executive(loginUser.iUserID, 0, 0);
            }
            else if (loginUser.sRoleName == "Branch Manager")
            {
                dt = bllBranches.GetBranchFilter_Branch_Manager(loginUser.iUserID, 0, 0);
            }
            else
            {
                dt = bllBranches.GetBranchFilter(loginUser.iUserID, 0, 0);
            }

            ddlBranch.DataSource = dt;
            ddlBranch.DataBind();

            ddlBranch.Enabled = true;
        }


        #endregion


        BindOther();

        var folderId = pointFolderInfo != null ? pointFolderInfo.FolderId : 0;
        var fileName = pointFileInfo != null ? pointFileInfo.Name : "";

        #region btnDisabled
//1. Create Point File可用
//a. folder name或filename为空时
//b. Folder name和filename不为空时, 但Point文件不存在
//2. Update Point File可用
//a. Folder name和filename不为空时, 以及Point文件存在
//3. Sync Now 可用
//a. Folder name和filename不为空时, 以及Point文件存在

        var pointFileWcf = GetPointFileInfo();
        btnCreatePointFile.Disabled = true;
        btnSyncNow.Disabled         = true;
        btnUpdatePoint.Disabled     = true;

        //Create Point File
        if (folderId == 0 || string.IsNullOrEmpty(pointFileInfo.Name))
        {
            btnCreatePointFile.Disabled = false;
        }
        else if (!pointFileWcf.FileExists) //not exists
        {
            btnCreatePointFile.Disabled = false;
        }
        else
        {
            btnSyncNow.Disabled     = false;
            btnUpdatePoint.Disabled = false;
        }


        #endregion

        if (folderId != 0)
        {
            ddlFolderName.Enabled = false;
        }
        if (!string.IsNullOrEmpty(fileName))
        {
            txbFilename.Enabled = false;
        }
    }