protected void Page_Load(object sender, EventArgs e)
    {
        objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();

        if (!Page.IsPostBack)
        {
            objCommonMIS.GetUserRegions(ddlRegion);
            //In case of one Region Only Make default selected
            if (ddlRegion.Items.Count == 2)
            {
                ddlRegion.SelectedIndex = 1;
            }
            objCommonMIS.RegionSno = ddlRegion.SelectedValue;
            objCommonMIS.GetUserBranchs(ddlBranch);
            if (ddlBranch.Items.Count == 2)
            {
                ddlBranch.SelectedIndex = 1;
            }
            objCommonMIS.BranchSno = ddlBranch.SelectedValue;

            objCommonMIS.GetUserSCs(ddlSerContractor);
            //Code By Binay Bind CheckListBox By SC Name
            sqlParamSrh[4].Value = ddlSerContractor.SelectedValue;
            objSCTerritoryDivision.BindProductDivision(checkLProductDivision, Convert.ToInt32(sqlParamSrh[4].Value));
            //End
            if (ddlSerContractor.Items.Count == 2)
            {
                ddlSerContractor.SelectedIndex = 1;
            }

            ViewState["Column"] = "SC_Name";
            ViewState["Order"]  = "ASC";
        }
        System.Threading.Thread.Sleep(int.Parse(ConfigurationManager.AppSettings["AjaxPleaseWaitTime"]));
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
            if (!Page.IsPostBack)
            {
                objCommonMIS.GetUserRegions(DdlRegion);

                if (DdlRegion.Items.Count == 2)
                {
                    DdlRegion.SelectedIndex = 1;
                }
                objCommonMIS.RegionSno = DdlRegion.SelectedValue;
                objCommonMIS.GetUserBranchs(DDlBranch);
                if (DDlBranch.Items.Count == 2)
                {
                    DDlBranch.SelectedIndex = 1;
                }
                objCommonMIS.BranchSno = DDlBranch.SelectedValue;
                objCommonMIS.GetUserSCs(ddlSerContractor);
                if (ddlSerContractor.Items.Count == 2)
                {
                    ddlSerContractor.SelectedIndex = 1;
                }
                BindGrid();
            }
        }
        catch (Exception ex)
        {
            CommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();

        if (!Page.IsPostBack)
        {
            TimeSpan duration = new TimeSpan(0, 0, 0, 0);
            txtFromDate.Text = DateTime.Now.Add(duration).ToShortDateString();
            txtToDate.Text   = DateTime.Now.Add(duration).ToShortDateString();
            objCommonMIS.GetUserRegions(ddlRegion);
            //In case of one Region Only Make default selected
            if (ddlRegion.Items.Count == 2)
            {
                ddlRegion.SelectedIndex = 1;
            }
            objCommonMIS.RegionSno = ddlRegion.SelectedValue;
            objCommonMIS.GetUserBranchs(ddlBranch);
            if (ddlBranch.Items.Count == 2)
            {
                ddlBranch.SelectedIndex = 1;
            }
            objCommonMIS.BranchSno        = ddlBranch.SelectedValue;
            objCommonMIS.BusinessLine_Sno = "2";
            objCommonMIS.GetUserProductDivisions(ddlProductDivision);
            if (ddlProductDivision.Items.Count == 2)
            {
                ddlProductDivision.SelectedIndex = 1;
            }
            ViewState["Column"] = "SC_Sno";
            ViewState["Order"]  = "ASC";
        }
    }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            param[0].Direction = ParameterDirection.ReturnValue;
            objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
            if (!Page.IsPostBack)
            {
                objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
                objCommonMIS.GetUserRegions(ddlRegion);

                objCommonMIS.ProductDivisionsWithUser(ddlProductDivision);
                if (ddlProductDivision.Items.Count == 2)
                {
                    ddlProductDivision.SelectedIndex = 1;
                }

                for (int i = DateTime.Now.Year; i >= DateTime.Now.Year - 2; i--)
                {
                    ddlYear.Items.Add(new ListItem(i.ToString(), i.ToString()));
                }

                for (int i = 1; i <= 12; i++)
                {
                    ddlMonth.Items.Add(new ListItem(mfi.GetMonthName(i).ToString(), i.ToString()));
                }
            }
        }
        catch (Exception ex)
        {
            CommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
Esempio n. 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         objCommonMIS.EmpId = Membership.GetUser().UserName;
         objCommonMIS.GetUserRegions(ddlRegion);
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
            if (!Page.IsPostBack)
            {
                DataSet ds = new DataSet();

                TimeSpan duration = new TimeSpan(0, 0, 0, 0);
                txtFromDate.Text = DateTime.Now.Add(duration).ToShortDateString();
                txtToDate.Text   = DateTime.Now.Add(duration).ToShortDateString();
                objCommonMIS.GetUserRegions(ddlRegion);

                //In case of one Region Only Make default selected
                if (ddlRegion.Items.Count == 2)
                {
                    ddlRegion.SelectedIndex = 1;
                }
                if (ddlRegion.Items.Count != 0)
                {
                    objCommonMIS.RegionSno = ddlRegion.SelectedValue;
                }
                else
                {
                    objCommonMIS.RegionSno = "0";
                }

                objCommonMIS.GetUserBranchs(ddlBranch);
                if (ddlBranch.Items.Count == 2)
                {
                    ddlBranch.SelectedIndex = 1;
                }
                objCommonMIS.BranchSno = ddlBranch.SelectedValue;

                objCommonMIS.GetUserProductDivisionsForRepeateComplaint(ddlProductDivision);

                if (ddlProductDivision.Items.Count == 2)
                {
                    ddlProductDivision.SelectedIndex = 1;
                }

                objCommonMIS.GetUserSCs(ddlSC);
                if (ddlSC.Items.Count == 2)
                {
                    ddlSC.SelectedIndex = 1;
                }

                ViewState["Column"] = "Complaint_refno";
                ViewState["Order"]  = "ASC";
            }
        }
        catch (Exception ex)
        {//Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            CommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            param[0].Direction = ParameterDirection.ReturnValue;
            objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
            if (!Page.IsPostBack)
            {
                objCommonMIS.GetUserBusinessLine(ddlBusinessLine);
                if (ddlBusinessLine.Items.Count != 0)
                {
                    objCommonMIS.BusinessLine_Sno = ddlBusinessLine.SelectedValue;
                }
                else
                {
                    objCommonMIS.BusinessLine_Sno = "0";
                }


                objCommonMIS.GetUserRegions(ddlRegion);

                //In case of one Region Only Make default selected
                if (ddlRegion.Items.Count == 2)
                {
                    ddlRegion.SelectedIndex = 1;
                }
                objCommonMIS.RegionSno = ddlRegion.SelectedValue;
                objCommonMIS.GetUserBranchs(ddlBranch);
                if (ddlBranch.Items.Count == 2)
                {
                    ddlBranch.SelectedIndex = 1;
                }
                objCommonMIS.BranchSno        = ddlBranch.SelectedValue;
                objCommonMIS.BusinessLine_Sno = ddlBusinessLine.SelectedValue.ToString();
                objCommonMIS.GetUserProductDivisions(ddlProductDivision);
                if (ddlProductDivision.Items.Count == 2)
                {
                    ddlProductDivision.SelectedIndex = 1;
                }
                objCommonMIS.GetUserSCs(ddlSC);
                if (ddlSC.Items.Count == 2)
                {
                    ddlSC.SelectedIndex = 1;
                }
                ViewState["Column"] = "Branch_Name";
                ViewState["Order"]  = "ASC";
            }
        }
        catch (Exception ex)
        {//Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            CommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
Esempio n. 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            // param[0].Direction = ParameterDirection.ReturnValue;
            objCommonMIS.EmpId            = Membership.GetUser().UserName;
            objCommonMIS.BusinessLine_Sno = "2";
            if (!Page.IsPostBack)
            {
                objCommonMIS.GetUserRegions(ddlRegion);
                if (ddlRegion.Items.Count == 2)
                {
                    ddlRegion.SelectedIndex = 1;
                }
                objCommonMIS.RegionSno = ddlRegion.SelectedValue;
                objCommonMIS.GetUserBranchs(ddlBranch);
                if (ddlBranch.Items.Count == 2)
                {
                    ddlBranch.SelectedIndex = 1;
                }
                objCommonMIS.BranchSno = ddlBranch.SelectedValue;
                objCommonMIS.GetUserProductDivisions(ddlProductDivison);
                ddlProductDivison.Items[0].Text = "Select";
                if (ddlProductDivison.Items.Count == 2)
                {
                    ddlProductDivison.SelectedIndex = 1;
                }
                string[] names;
                int      countElements;
                names = Enum.GetNames(typeof(CIC.MyMonth));
                for (countElements = 0; countElements <= names.Length - 1; countElements++)
                {
                    ddlMonth.Items.Add(new ListItem(names[countElements], countElements.ToString()));
                }

                // Initilizise the default values
                ddlMonth.Items[1].Selected = true;
                DdlYear.Items.FindByText(DateTime.Today.Year.ToString()).Selected = true;
            }
        }
        catch (Exception ex)
        {
            CommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            param[0].Direction = ParameterDirection.ReturnValue;
            objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
            if (!Page.IsPostBack)
            {
                objCommonMIS.GetUserRegions(ddlRegion);

                //In case of one Region Only Make default selected
                if (ddlRegion.Items.Count == 2)
                {
                    ddlRegion.SelectedIndex = 1;
                }
                objCommonMIS.RegionSno = ddlRegion.SelectedValue;
                objCommonMIS.GetUserBranchs(ddlBranch);
                if (ddlBranch.Items.Count == 2)
                {
                    ddlBranch.SelectedIndex = 1;
                }
                objCommonMIS.BranchSno = ddlBranch.SelectedValue;
                objCommonMIS.GetUserProductDivisions(ddlProductDivision);
                if (ddlProductDivision.Items.Count == 2)
                {
                    ddlProductDivision.SelectedIndex = 1;
                }
                objCommonMIS.GetUserSCs(ddlServiceContractor);
                if (ddlServiceContractor.Items.Count == 2)
                {
                    ddlServiceContractor.SelectedIndex = 1;
                }
                ViewState["Column"] = "yea,mon,[Week]";
                ViewState["Order"]  = "ASC";
                //Binding Year DropdownLists
                BindYearDdl(ddlFromYr);
                BindYearDdl(ddlToYr);
            }
        }
        catch (Exception ex)
        {//Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            CommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            param[0].Direction = ParameterDirection.ReturnValue;
            objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
            if (!Page.IsPostBack)
            {
                TimeSpan duration = new TimeSpan(0, 0, 0, 0);
                txtToDate.Text = DateTime.Now.Add(duration).ToShortDateString();
                duration.Add(new TimeSpan(-1, 0, 0, 0));
                txtFromDate.Text = DateTime.Now.Add(duration).ToShortDateString();



                objCommonMIS.GetUserRegions(ddlRegion);
                objCommonMIS.BusinessLine_Sno = "2";

                if (ddlRegion.Items.Count == 2)
                {
                    ddlRegion.SelectedIndex = 1;
                }
                objCommonMIS.RegionSno = ddlRegion.SelectedValue;
                objCommonMIS.GetUserBranchs(ddlBranch);
                if (ddlBranch.Items.Count == 2)
                {
                    ddlBranch.SelectedIndex = 1;
                }
                objCommonMIS.BranchSno = ddlBranch.SelectedValue;

                objCommonMIS.GetUserProductDivisions(ddlProductDivision);
                if (ddlProductDivision.Items.Count == 2)
                {
                    ddlProductDivision.SelectedIndex = 1;
                }
            }
        }
        catch (Exception ex)
        {
            CommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
Esempio n. 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            objCommonMIS.EmpId = User.Identity.Name;

            objCommonMIS.GetUserRegions(ddlRegion);
            if (ddlRegion.Items.Count == 2)
            {
                ddlRegion.SelectedIndex = 1;
            }
            objCommonMIS.RegionSno = ddlRegion.SelectedValue;
            objCommonMIS.GetUserBranchs(ddlBranch);
            if (ddlBranch.Items.Count == 2)
            {
                ddlBranch.SelectedIndex = 1;
            }
            objCommonMIS.BusinessLine_Sno = "2";
            Objcf.BindProductDivision(ddlUnit);
        }
    }
Esempio n. 12
0
    private void BindControl()
    {
        try
        {
            if (Roles.IsUserInRole(Membership.GetUser().UserName, "SC") || Roles.IsUserInRole(Membership.GetUser().UserName, "SC_SIMS"))
            {
                objCombo.EmpId = Membership.GetUser().UserName;
                objCombo.BindSCProductDivisionByUsername(ddlProductDivision);
            }
            else
            {
                objCommonMIS.EmpId            = Membership.GetUser().UserName;
                objCommonMIS.BusinessLine_Sno = "2";
                objCommonMIS.GetUserRegions(ddlRegion);
                if (ddlRegion.Items.Count == 2)
                {
                    ddlRegion.SelectedIndex = 1;
                }
                objCommonMIS.RegionSno = ddlRegion.SelectedValue;
                objCommonMIS.GetUserBranchs(ddlBranches);
                if (ddlBranches.Items.Count == 2)
                {
                    ddlBranches.SelectedIndex = 1;
                }
                objCommonMIS.BranchSno = ddlBranches.SelectedValue;
                objCommonMIS.GetUserSCs(ddlAsc);
                if (ddlAsc.Items.Count == 2)
                {
                    ddlAsc.SelectedIndex = 1;
                }

                objCommonMIS.GetUserProductDivisions(ddlProductDivision);
            }
        }
        catch (Exception ex)
        {
            CommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
Esempio n. 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try{
            objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
            if (!Page.IsPostBack)
            {
                TimeSpan duration = new TimeSpan(0, 0, 0, 0);
                txtFromDate.Text = DateTime.Now.Add(duration).ToShortDateString();
                txtToDate.Text   = DateTime.Now.Add(duration).ToShortDateString();

                objCommonMIS.GetUserRegions(ddlRegion);
                //In case of one Region Only Make default selected
                if (ddlRegion.Items.Count == 2)
                {
                    ddlRegion.SelectedIndex = 1;
                }
                objCommonMIS.RegionSno = ddlRegion.SelectedValue;
                objCommonMIS.GetUserBranchs(ddlBranch);
                if (ddlBranch.Items.Count == 2)
                {
                    ddlBranch.SelectedIndex = 1;
                }
                objCommonMIS.BranchSno = ddlBranch.SelectedValue;
                objCommonMIS.GetUserProductDivisions(ddlProductDivison);
                if (ddlProductDivison.Items.Count == 2)
                {
                    ddlProductDivison.SelectedIndex = 1;
                }
                ViewState["Column"] = "Complaint_Refno";
                ViewState["Order"]  = "ASC";
            }
            System.Threading.Thread.Sleep(int.Parse(ConfigurationManager.AppSettings["AjaxPleaseWaitTime"]));
        }
        catch (Exception ex)
        {
            CommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }