示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblError.Visible = false;
            if (!IsPostBack)
            {
                salesReportUtils.FillBranchesAndChainSession(Session["UserID"].ToString());

                cldStartDt.SelectedDate = Convert.ToDateTime(DateTime.Now.AddDays(-6).ToShortDateString());
                cldStartDt.VisibleDate  = Convert.ToDateTime(DateTime.Now.AddDays(-6).ToShortDateString());
                cldEndDt.SelectedDate   = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                cldEndDt.VisibleDate    = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                hidEndDt.Value          = cldEndDt.SelectedDate.ToShortDateString();
                hidStartDt.Value        = cldStartDt.SelectedDate.ToShortDateString();

                FillBranches();
                FillTerritory();
                FillOutsideRep();
                FillShipMethod();
                FillInsideRep();
                FillRegionalMgr();
                FillPriceCd();
                FillOrderSource();
                FillBuyGroup();
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblError.Visible = false;
            if (!IsPostBack)
            {
                salesReportUtils.FillBranchesAndChainSession(Session["UserID"].ToString());

                //cldStartDt.SelectedDate = Convert.ToDateTime("12/23/2007");
                //cldStartDt.VisibleDate = Convert.ToDateTime("12/23/2007");
                //cldEndDt.SelectedDate = Convert.ToDateTime("01/26/2008");
                //cldEndDt.VisibleDate = Convert.ToDateTime("01/26/2008");
                hidEndDt.Value   = cldEndDt.SelectedDate.ToShortDateString();
                hidStartDt.Value = cldStartDt.SelectedDate.ToShortDateString();

                FillBranches();
                for (int i = 0; i <= ddlBranch.Items.Count - 1; i++)
                {
                    if (ddlBranch.Items[i].Value.Trim() == Session["BranchID"].ToString())
                    {
                        ddlBranch.Items[i].Selected = true;
                        break;
                    }
                }
                FillShipMethod();
                FillSalesPerson();
                FillPriceCd();
                FillOrderSource();
            }
        }
示例#3
0
文件: Frame.aspx.cs 项目: 2Nifty/PFC
        /// <summary>
        /// PageLoad Event Handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Response.Expires = -1;

                if (Session["UserId"] != null && Session["CompanyID"] != null && Session["UserName"] != null)
                {
                    UserSession objUserSession = new UserSession();
                    objUserSession.InsertSession(Session["UserId"].ToString(), Session["CompanyID"].ToString(), Session["UserName"].ToString());

                    // Fill Authorized branches in Session
                    SalesReportUtils salesReport = new SalesReportUtils();
                    salesReport.FillBranchesAndChainSession(Session["UserID"].ToString());
                }
                else if (Session["SessionID"] == null)
                {
                    HttpContext.Current.Response.Redirect(PFC.Intranet.Global.IntranetSiteURL + "/SystemFrameSet/SessionOut.aspx");
                }
            }

            catch (Exception ex)
            {
                throw;
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Ajax.Utility.RegisterTypeForAjax(typeof(ItemBranchActivityPrompt));

            Session["UserID"]    = ((Session["UserID"] != null) ? Session["UserID"].ToString() : "Testing");
            Session["SessionID"] = ((Session["SessionID"] != null) ? Session["SessionID"].ToString() : "null");
            Session["SortAC"]    = " CurDate ASC";

            //lblError.Visible = false;
            if (!IsPostBack)
            {
                salesReportUtils.FillBranchesAndChainSession(Session["UserID"].ToString());

                FillBranches();     // Fill The Branches in the Combo
                hidEndDt.Value   = cldEndDt.SelectedDate.ToShortDateString();
                hidStartDt.Value = cldStartDt.SelectedDate.ToShortDateString();

                for (int i = 0; i <= ddlBranch.Items.Count - 1; i++)
                {
                    if (ddlBranch.Items[i].Value.Trim() == Session["BranchID"].ToString())
                    {
                        ddlBranch.Items[i].Selected = true;
                        break;
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //Session["SessionID"] = "1234";
            //Session["BranchID"] = "01";
            //Session["UserID"]   = "200";
            //Session["UserName"] = "******";
            salesReportUtils.FillBranchesAndChainSession(Session["UserID"].ToString());
            lblError.Text = "";
            if (!IsPostBack)
            {
                cldStartDt.Visible = false;
                cldEndDt.Visible   = false;
                tdRange.Visible    = false;

                ddlYear.Items.Clear();
                string strYear = string.Empty;
                for (int i = 0; ; i++)
                {
                    strYear = i.ToString();
                    strYear = (strYear.Length == 1) ? "200" + i.ToString() : "20" + i.ToString();
                    if (Convert.ToInt32(strYear) > DateTime.Now.Year)
                    {
                        break;
                    }

                    ddlYear.Items.Insert(i, new ListItem(strYear, strYear));
                }
                //
                // Fill The Branches in the Combo
                //
                FillBranches();

                int month = (int)DateTime.Now.Month;
                int year  = Convert.ToInt16(DateTime.Now.Year.ToString().Substring(2));
                if (month != 1)
                {
                    ddlMonth.Items[month - 2].Selected = true;
                    ddlYear.Items[year].Selected       = true;
                }
                else
                {
                    ddlMonth.Items[ddlMonth.Items.Count - 1].Selected = true;
                    ddlYear.Items[year - 1].Selected = true;
                }


                for (int i = 0; i <= ddlBranch.Items.Count - 1; i++)
                {
                    if (ddlBranch.Items[i].Value.Trim() == Session["BranchID"].ToString())
                    {
                        ddlBranch.Items[i].Selected = true;
                        break;
                    }
                }

                //if(ddlBranch.SelectedIndex == 0)
                FillCSRs();
            }
        }