Пример #1
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)
    {
        PageSize = 10;

        txtLoggedDateFrom.Attributes.Add("onchange", "SelectDate('logged');");
        txtLoggedDateTo.Attributes.Add("onchange", "SelectDate('logged');");
        btnSearch.Attributes.Add("onclick", "return SelectDate('validate');");

        objFHPMotorsDetails.UserName = Membership.GetUser().UserName.ToString();
        objCommonMIS.EmpId           = objFHPMotorsDetails.UserName;
        if (!Page.IsPostBack)
        {
            btnExportExcel.Visible = false;
            objCommonMIS.GetUserBusinessLine(ddlBusinessLine);
            objCommonMIS.BusinessLine_Sno = ddlBusinessLine.SelectedValue;
            objCommonMIS.GetUserRegionsMTS_MTO(ddlRegion);
            objCommonMIS.RegionSno = string.IsNullOrEmpty(ddlRegion.SelectedValue) ? "0" : ddlRegion.SelectedValue;
            objCommonMIS.GetUserBranchs(ddlBranch);
            objCommonMIS.BranchSno = string.IsNullOrEmpty(ddlBranch.SelectedValue) ? "0" : ddlBranch.SelectedValue;
            objCommonMIS.GetUserSCs(ddlSerContractor);
            if (ddlSerContractor.Items.Count == 2)
            {
                ddlSerContractor.SelectedIndex = 1;
            }
            ddlProductDivison.Items.Insert(0, new ListItem("FHP Motor", "19"));
            BindListBasedOnProductDivision();
            ViewState["Column"] = "SplitComplaintRefNo";
            ViewState["Order"]  = "Desc";
        }
        System.Threading.Thread.Sleep(int.Parse(ConfigurationManager.AppSettings["AjaxPleaseWaitTime"]));
    }
    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";
        }
    }
    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"]));
    }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
            objCommonMIS.GetUserBusinessLine(ddlBusinessLine);
            objCommonMIS.BusinessLine_Sno = ddlBusinessLine.SelectedValue;
            objCommonMIS.GetUserRegionsMTS_MTO(ddlRegion);
            objCommonMIS.RegionSno = ddlRegion.SelectedValue;
            objCommonMIS.GetUserBranchs(ddlBranch);
            ddlBranch.Items.Insert(0, new ListItem("All", "0"));
            objCommonMIS.BranchSno = ddlBranch.SelectedValue;
            objCommonMIS.GetUserProductDivisions(ddlProductDivison);
            ddlProductDivison.Items.Insert(0, new ListItem("Pumps", "16"));
            ddlProductDivison.SelectedValue          = "16";
            objDefectAnalysisRpt.ProductDivision_Sno = 16;
            ddlProductDivison.DataBind();
            objDefectAnalysisRpt.BindAllProductLineDdl(ddlProductLine);
            ddlProductDivison.Enabled = false;
            //ddlProductLine.Items.Insert(0, new ListItem("All", "0"));
            txtLoggedDateFrom.Text = DateTime.Today.AddDays(-7).ToString("MM/dd/yyyy");
            txtLoggedDateTo.Text   = DateTime.Today.AddDays(0).ToString("MM/dd/yyyy");

            btnExportExcel.Visible = false;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
        if (!IsPostBack)
        {
            objCommonMIS.BusinessLine_Sno = "2";
            objCommonMIS.GetUserRegionsMTS_MTO(ddlRegion);
            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.GetUserProductDivisions(ddlProductDivison);
            BindModeOfReceipt();
        }
    }
    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());
        }
    }
Пример #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageSize = 10;

        GenerateLinkBtn();

        txtDefectFrom.Attributes.Add("onchange", "SelectDate('defect');");
        txtDefectTo.Attributes.Add("onchange", "SelectDate('defect');");

        txtSLADateFrom.Attributes.Add("onchange", "SelectDate('sla');");
        txtSLADateTo.Attributes.Add("onchange", "SelectDate('sla');");

        txtLoggedDateFrom.Attributes.Add("onchange", "SelectDate('logged');");
        txtLoggedDateTo.Attributes.Add("onchange", "SelectDate('logged');");
        btnSearch.Attributes.Add("onclick", "return SelectDate('validate');");

        objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
        if (!Page.IsPostBack)
        {
            ViewState["upto"]      = null;
            ViewState["First"]     = 1;
            ViewState["Last"]      = PageSize;
            ViewState["strOrder"]  = " ASC";
            btnExportExcel.Visible = false;
            //TimeSpan duration = new TimeSpan(0, 0, 0, 0);
            //txtFromDate.Text = DateTime.Now.Add(duration).ToShortDateString();
            //txtToDate.Text = DateTime.Now.Add(duration).ToShortDateString();

            objCommonMIS.GetUserBusinessLine(ddlBusinessLine);
            objCommonMIS.BusinessLine_Sno = ddlBusinessLine.SelectedValue;
            objCommonMIS.GetUserRegionsMTS_MTO(ddlRegion);
            objCommonMIS.RegionSno = ddlRegion.SelectedValue;
            objCommonMIS.GetUserBranchs(ddlBranch); // bhawesh 8 may 12
            // ddlBranch.Items.Insert(0, new ListItem("All", "0")); // bhawesh 8 may 12
            objCommonMIS.BranchSno = ddlBranch.SelectedValue;
            objCommonMIS.GetUserProductDivisions(ddlProductDivison);
            ddlProductLine.Items.Insert(0, new ListItem("All", "0"));
            ddlProductGroup.Items.Insert(0, new ListItem("All", "0"));
            ddlProduct.Items.Insert(0, new ListItem("All", "0"));
            ddlDefectCategory.Items.Clear();
            ddlDefectCategory.Items.Insert(0, new ListItem("All", "0"));
            //objDefectAnalysisRpt.BindDefectCatDdl(ddlDefectCategory, Convert.ToInt32(ddlBusinessLine.SelectedValue), Convert.ToInt32(ddlProductDivison.SelectedValue), Convert.ToInt32(ddlProductLine.SelectedValue));
            ddlDefect.Items.Insert(0, new ListItem("All", "0"));
            ViewState["Column"] = "Complaint_Split";
            ViewState["Order"]  = "ASC";
            //if (Convert.ToInt32(ddlBusinessLine.SelectedValue) == 1)
            //{
            //    trPGroup.Visible = false;
            //}
            //else
            //{
            //    trPGroup.Visible = true;
            //}
        }
        System.Threading.Thread.Sleep(int.Parse(ConfigurationManager.AppSettings["AjaxPleaseWaitTime"]));
    }
    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());
        }
    }
Пример #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     objCommonMIS.EmpId = Membership.GetUser().UserName;
     if (!Page.IsPostBack)
     {
         taxableAmt = 0.00;
         if (!Roles.GetRolesForUser(objCommonMIS.EmpId).Any(x => (x.Contains("SC") || x.Contains("SC_SIMS"))))
         {
             objCommonMIS.BusinessLine_Sno = "2";
             objCommonMIS.GetUserRegionsMTS_MTO(ddlRegion);
             if (ddlRegion.Items.Count > 0)
             {
                 ddlRegion.SelectedIndex = 0;
             }
             if (ddlRegion.Items.FindByValue("8").Value.Equals("8"))
             {
                 ListItem lstRegion = ddlRegion.Items.FindByValue("8");
                 ddlRegion.Items.Remove(lstRegion);
             }
             objCommonMIS.RegionSno = ddlRegion.SelectedValue;
             objCommonMIS.GetUserBranchs(ddlBranch);
             objCommonMIS.BranchSno = ddlBranch.SelectedValue;
             objCommonMIS.GetUserSCs(ddlSerContractor);
             if (ddlSerContractor.Items.Count == 2)
             {
                 ddlSerContractor.SelectedIndex = 1;
             }
             ddlSerContractor.Visible    = false;
             lblASCShowHide.Visible      = false;
             TrInvoiceHideShow.Visible   = false;
             ShowHideInvoiceDate.Visible = false;
             ClearSearchControl();
         }
         else
         {
             UserMaster objUserMaster = new UserMaster();
             objUserMaster.BindUseronUserName(Membership.GetUser().UserName.ToString(), "SELECT_USER_BY_USRNAME");
             trRB.Visible = false;
             ddlSerContractor.Items.Clear();
             ddlSerContractor.Items.Add(new ListItem(objUserMaster.Name.ToString()));
             ddlSerContractor.SelectedIndex = 0;
             ddlSerContractor.Enabled       = false;
             ddlSerContractor.Visible       = true; // Added by Mukesh  as on 24 Jun 2015
             lblASCShowHide.Visible         = true;
             TrInvoiceHideShow.Visible      = true;
         }
     }
 }
Пример #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageSize = 10;

        GenerateLinkBtn();

        txtDefectFrom.Attributes.Add("onchange", "SelectDate('defect');");
        txtDefectTo.Attributes.Add("onchange", "SelectDate('defect');");

        txtSLADateFrom.Attributes.Add("onchange", "SelectDate('sla');");
        txtSLADateTo.Attributes.Add("onchange", "SelectDate('sla');");

        txtLoggedDateFrom.Attributes.Add("onchange", "SelectDate('logged');");
        txtLoggedDateTo.Attributes.Add("onchange", "SelectDate('logged');");
        btnSearch.Attributes.Add("onclick", "return SelectDate('validate');");

        objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
        if (!Page.IsPostBack)
        {
            ViewState["upto"]      = null;
            ViewState["First"]     = 1;
            ViewState["Last"]      = PageSize;
            ViewState["strOrder"]  = " ASC";
            btnExportExcel.Visible = false;

            objCommonMIS.GetUserBusinessLine(ddlBusinessLine);
            objCommonMIS.BusinessLine_Sno = ddlBusinessLine.SelectedValue;
            objCommonMIS.GetUserRegionsMTS_MTO(ddlRegion);
            objCommonMIS.RegionSno = ddlRegion.SelectedValue;
            objCommonMIS.GetUserBranchs(ddlBranch); // bhawesh 8 may 12
            objCommonMIS.BranchSno = ddlBranch.SelectedValue;
            objCommonMIS.GetUserSCs(ddlSerContractor);
            if (ddlSerContractor.Items.Count == 2)
            {
                ddlSerContractor.SelectedIndex = 1;
            }
            objCommonMIS.GetUserProductDivisions(ddlProductDivison);
            ddlProductLine.Items.Insert(0, new ListItem("All", "0"));
            ddlProductGroup.Items.Insert(0, new ListItem("All", "0"));
            ddlProduct.Items.Insert(0, new ListItem("All", "0"));
            ddlDefectCategory.Items.Clear();
            ddlDefectCategory.Items.Insert(0, new ListItem("All", "0"));
            ddlDefect.Items.Insert(0, new ListItem("All", "0"));
            ViewState["Column"] = "Complaint_Split";
            ViewState["Order"]  = "ASC";
        }
        System.Threading.Thread.Sleep(int.Parse(ConfigurationManager.AppSettings["AjaxPleaseWaitTime"]));
    }
Пример #12
0
    protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            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;
            }
            ddlBranch.Items[0].Text          = "Select";
            ddlProductDivision.Items[0].Text = "Select";
        }
        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.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());
        }
    }
Пример #14
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)
            {
                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());
        }
    }
Пример #16
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());
        }
    }
Пример #17
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());
        }
    }
Пример #18
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);
        }
    }
    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.GetUserRegionsMTS_MTO(ddlRegion);

                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.GetUserProductDivisions(ddlProductDivision);

                if (ddlProductDivision.Items.Count == 2)
                {
                    ddlProductDivision.SelectedIndex = 1;
                }
                if (ddlBusinessLine.SelectedValue == "2")
                {
                    trResolvertype.Visible         = false;
                    divSC.Visible                  = true;
                    trResolvertype.Visible         = false;
                    ddlResolver.SelectedIndex      = 0;
                    ddlSC.SelectedIndex            = 0;
                    trCGExce.Visible               = false;
                    ddlCGExec.SelectedIndex        = 0;
                    trCgContractEmp.Visible        = false;
                    ddlCGContractEmp.SelectedIndex = 0;
                }
                else
                {
                    trResolvertype.Visible         = true;
                    divSC.Visible                  = false;
                    trResolvertype.Visible         = true;
                    ddlResolver.SelectedIndex      = 0;
                    ddlSC.SelectedIndex            = 0;
                    trCGExce.Visible               = false;
                    ddlCGExec.SelectedIndex        = 0;
                    trCgContractEmp.Visible        = false;
                    ddlCGContractEmp.SelectedIndex = 0;
                }


                objCommonMIS.GetUserSCs(ddlSC);
                if (ddlSC.Items.Count == 2)
                {
                    ddlSC.SelectedIndex = 1;
                }
                objServiceContractor.BindCGEmployee(ddlCGExec);
                AddAllInDdl(ddlCGExec);
                objServiceContractor.BindCGContract(ddlCGContractEmp);
                AddAllInDdl(ddlCGContractEmp);
                ViewState["Column"] = "yea,mon,[Week]";
                ViewState["Order"]  = "ASC";
                BindYearDdl(ddlFromYr);
                BindYearDdl(ddlToYr);
            }
        }
        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.GetUserBusinessLine(ddlBusinessLine);
                if (ddlBusinessLine.Items.Count != 0)
                {
                    objCommonMIS.BusinessLine_Sno = ddlBusinessLine.SelectedValue;
                }
                else
                {
                    objCommonMIS.BusinessLine_Sno = "0";
                }

                objCommonMIS.GetUserRegionsMTS_MTO(ddlRegion);
                if (ddlRegion.Items.Count > 1)
                {
                    ddlRegion.Items.RemoveAt(0);
                    ddlRegion.Items.Insert(0, new ListItem("Select", "0"));
                }
                //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 > 1)
                {
                    ddlBranch.Items.RemoveAt(0);
                    ddlBranch.Items.Insert(0, new ListItem("Select", "0"));
                }
                if (ddlBranch.Items.Count == 2)
                {
                    ddlBranch.SelectedIndex = 1;
                }
                objCommonMIS.BranchSno = ddlBranch.SelectedValue;

                objCommonMIS.GetUserProductDivisions(ddlProductDivision);
                if (ddlProductDivision.Items.Count > 1)
                {
                    ddlProductDivision.Items.RemoveAt(0);
                    ddlProductDivision.Items.Insert(0, new ListItem("Select", "0"));
                }
                if (ddlProductDivision.Items.Count == 2)
                {
                    ddlProductDivision.SelectedIndex = 1;
                }

                if (ddlBusinessLine.SelectedValue == "2")
                {
                    trResolvertype.Visible         = false;
                    divSC.Visible                  = true;
                    trResolvertype.Visible         = false;
                    ddlResolver.SelectedIndex      = 0;
                    ddlSC.SelectedIndex            = 0;
                    trCGExce.Visible               = false;
                    ddlCGExec.SelectedIndex        = 0;
                    trCgContractEmp.Visible        = false;
                    ddlCGContractEmp.SelectedIndex = 0;
                }
                else
                {
                    trResolvertype.Visible         = true;
                    divSC.Visible                  = false;
                    trResolvertype.Visible         = true;
                    ddlResolver.SelectedIndex      = 0;
                    ddlSC.SelectedIndex            = 0;
                    trCGExce.Visible               = false;
                    ddlCGExec.SelectedIndex        = 0;
                    trCgContractEmp.Visible        = false;
                    ddlCGContractEmp.SelectedIndex = 0;
                }

                objCommonMIS.GetUserSCs(ddlSC);
                if (ddlSC.Items.Count == 2)
                {
                    ddlSC.SelectedIndex = 1;
                }
                objServiceContractor.BindCGEmployee(ddlCGExec); //For CG User
                AddAllInDdl(ddlCGExec);                         //Bind CG User
                if (ddlBusinessLine.SelectedValue == "1")
                {
                    AddAllInDdl(ddlCGContractEmp);//Bind CG Contact Emplyee
                }
                //End

                ViewState["Column"] = "Branch_Name";
                ViewState["Order"]  = "ASC";
            }
        }
        catch (Exception ex)
        {
            CommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
Пример #21
0
    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();

            //Code Added By Vijai//////////////

            objCommonMIS.GetUserBusinessLine(ddlBusinessLine);
            if (ddlBusinessLine.Items.Count != 0)
            {
                objCommonMIS.BusinessLine_Sno = ddlBusinessLine.SelectedValue;
            }
            else
            {
                objCommonMIS.BusinessLine_Sno = "0";
            }
            objCommonMIS.GetUserRegionsMTS_MTO(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.GetUserSCs(ddlSerContractor);
            //Add Code By Binay MTO--17-11-2009
            //objRequestReg.BindDdl(ddlCGExec, "2", "SELECT_CGEMPLOYEE");
            objServiceContractor.BindCGEmployee(ddlCGExec);
            AddAllInDdl(ddlCGExec);        //Bind CG User
            //objRequestReg.BindDdl(ddlCGContractEmp, "5", "SELECT_CG_CONTRACT");
            objServiceContractor.BindCGContract(ddlCGContractEmp);
            AddAllInDdl(ddlCGContractEmp);        //Bind CG Contact Emplyee
            objCommonMIS.GetUserProductDivisions(ddlProductDivison);
            if (ddlProductDivison.Items.Count == 2)
            {
                ddlProductDivison.SelectedIndex = 1;
            }

            //Add Code By Binay-30-11-2009
            if (ddlBusinessLine.SelectedValue == "2")
            {
                trResolvertype.Visible         = false;
                divSC.Visible                  = true;
                trResolvertype.Visible         = false;
                ddlResolver.SelectedIndex      = 0;
                ddlSerContractor.SelectedIndex = 0;
                trCGExce.Visible               = false;
                ddlCGExec.SelectedIndex        = 0;
                trCgContractEmp.Visible        = false;
                ddlCGContractEmp.SelectedIndex = 0;
            }
            else
            {
                trResolvertype.Visible         = true;
                divSC.Visible                  = false;
                trResolvertype.Visible         = true;
                ddlResolver.SelectedIndex      = 0;
                ddlSerContractor.SelectedIndex = 0;
                trCGExce.Visible               = false;
                ddlCGExec.SelectedIndex        = 0;
                trCgContractEmp.Visible        = false;
                ddlCGContractEmp.SelectedIndex = 0;
            }

            //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"]));
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //string userRole =  objCommonClass.GetRolesForUser(Membership.GetUser().UserName.ToString());
        objCommonMIS.EmpId = Membership.GetUser().UserName;

        if (!Page.IsPostBack)
        {
            // Bind Year and month
            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()));
            }
            ddlMonth.Items.Insert(0, new ListItem("Select", "0"));

            taxableAmt = 0.00;
            if (!Roles.GetRolesForUser(objCommonMIS.EmpId).Any(x => (x.Contains("SC") || x.Contains("SC_SIMS"))))
            {
                objCommonMIS.BusinessLine_Sno = "2";
                objCommonMIS.GetUserRegionsMTS_MTO(ddlRegion);
                if (ddlRegion.Items.Count > 0)
                {
                    ddlRegion.SelectedIndex = 0;
                }
                //if (ddlRegion.Items.FindByValue("8").Value.Equals("8"))
                //{
                //    ListItem lstRegion = ddlRegion.Items.FindByValue("8");
                //    ddlRegion.Items.Remove(lstRegion);
                //}
                objCommonMIS.RegionSno = ddlRegion.SelectedValue;
                objCommonMIS.GetUserBranchs(ddlBranch);
                objCommonMIS.BranchSno = ddlBranch.SelectedValue;
                objCommonMIS.GetUserSCs(ddlSerContractor);

                if (ddlSerContractor.Items.Count == 2)
                {
                    ddlSerContractor.SelectedIndex = 1;
                }
                //ddlSerContractor.Visible = false;  // Added by Mukesh  as on 24 Jun 2015
                //lblASCShowHide.Visible = false;
                TrInvoiceHideShow.Visible       = false;
                chkServicetaxoption.Visible     = false;
                lblServiceChargesBracks.Visible = false;
                ShowHideInvoiceDate.Visible     = false;
            }
            else
            {
                UserMaster objUserMaster = new UserMaster();
                objUserMaster.BindUseronUserName(Membership.GetUser().UserName.ToString(), "SELECT_USER_BY_USRNAME");
                trRB.Visible = false;
                ddlSerContractor.Items.Clear();
                ddlSerContractor.Items.Add(new ListItem(objUserMaster.Name.ToString()));
                ddlSerContractor.SelectedIndex = 0;
                ddlSerContractor.Enabled       = false;
                ddlSerContractor.Visible       = true; // Added by Mukesh  as on 24 Jun 2015
                lblASCShowHide.Visible         = true;
                TrInvoiceHideShow.Visible      = true;
                //InvoiceDetails();
            }
            ddlMonth.SelectedIndex = 6;
            // imglogo.Visible = false;
        }
    }
Пример #23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            btnSubmitBillDtls.Attributes.Add("onClick", "return BillNoValidation()");
            btnSearch.Attributes.Add("onClick", "return SelectDate()");
            objCommonMISCIC.EmpId = Membership.GetUser().UserName.ToString();
            objDivision.UserName  = objCommonMISCIC.EmpId;
            if (!Page.IsPostBack)
            {
                objCommonMISCIC.GetUserBusinessLine(ddlBusinessLine);
                objCommonMISCIC.BusinessLine_Sno = ddlBusinessLine.SelectedValue;
                objCommonMISCIC.GetUserRegionsMTS_MTO(ddlRegion);

                if (ddlRegion.Items.Count == 2)
                {
                    ddlRegion.SelectedIndex = 1;
                }
                if (ddlRegion.Items.Count != 0)
                {
                    objCommonMISCIC.RegionSno = ddlRegion.SelectedValue;
                }
                else
                {
                    objCommonMISCIC.RegionSno = "0";
                }
                if (ddlRegion.Items.Count == 2)
                {
                    ddlRegion.SelectedIndex = 1;
                }
                objCommonMISCIC.RegionSno = ddlRegion.SelectedValue;
                objCommonMISCIC.GetUserBranchs(ddlBranch);
                objCommonMISCIC.BranchSno = Convert.ToString(ddlBranch.SelectedValue);
                objCommonMISCIC.GetUserSCs(DDlAsc);
                if (DDlAsc.Items.Count == 2)
                {
                    DDlAsc.SelectedIndex = 1;
                }
                if (ddlBranch.Items.Count == 2)
                {
                    ddlBranch.SelectedIndex = 1;
                }
                //objCommonMISCIC.GetUserProductDivisions(ddlProductDivison);

                objDivision.RegionId = int.Parse(ddlRegion.SelectedValue);
                objDivision.BranchId = int.Parse(ddlBranch.SelectedValue);
                objDivision.SCSno    = int.Parse(DDlAsc.SelectedValue);
                objDivision.BindRegionBasedOnCondt(ddlProductDivison);
                if (ddlProductDivison.Items.Count == 2)
                {
                    ddlProductDivison.SelectedIndex = 1;
                }
                ViewState["Column"] = "InternalBillDate";
                ViewState["Order"]  = "ASC";
            }
            lblMessage.Text = "";
        }
        catch (Exception ex)
        {
        }
    }
Пример #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //string userRole =  objCommonClass.GetRolesForUser(Membership.GetUser().UserName.ToString());
        objCommonMIS.EmpId = Membership.GetUser().UserName;
        //ddlMonth.Enabled = false;
        Ddlyear.Enabled = false;
        if (!Page.IsPostBack)
        {
            int dt = DateTime.Now.Date.Day;

            if (dt >= 11 && dt <= 27)//// invoice open only these dyas
            {
                // Bind Year and month
                for (int i = DateTime.Now.Year; i >= DateTime.Now.Year - 2; i--)
                {
                    Ddlyear.Items.Add(new ListItem(i.ToString(), i.ToString()));
                }

                // uncomment latter
                //for (int i = 1; i <= 12; i++)
                //    ddlMonth.Items.Add(new ListItem(mfi.GetMonthName(i).ToString(), i.ToString()));
                //ddlMonth.Items.Insert(0, new ListItem("Select", "0"));


                for (int i = DateTime.Now.Month - 2; i <= DateTime.Now.Month; i++)
                {
                    ddlMonth.Items.Add(new ListItem(mfi.GetMonthName(i).ToString(), i.ToString()));
                }
                ddlMonth.Items.Insert(0, new ListItem("Select", "0"));



                // by @VT
                //ddlMonth.SelectedValue = Convert.ToString(DateTime.Now.Month - 1);
                // bind amount
                // after sep
                //  BindInvoiveAmount();


                taxableAmt = 0.00;
                if (!Roles.GetRolesForUser(objCommonMIS.EmpId).Any(x => (x.Contains("SC") || x.Contains("SC_SIMS"))))
                {
                    objCommonMIS.BusinessLine_Sno = "2";
                    objCommonMIS.GetUserRegionsMTS_MTO(ddlRegion);
                    if (ddlRegion.Items.Count > 0)
                    {
                        ddlRegion.SelectedIndex = 0;
                    }
                    if (ddlRegion.Items.FindByValue("8").Value.Equals("8"))
                    {
                        ListItem lstRegion = ddlRegion.Items.FindByValue("8");
                        ddlRegion.Items.Remove(lstRegion);
                    }
                    objCommonMIS.RegionSno = ddlRegion.SelectedValue;
                    objCommonMIS.GetUserBranchs(ddlBranch);
                    objCommonMIS.BranchSno = ddlBranch.SelectedValue;
                    objCommonMIS.GetUserSCs(ddlSerContractor);
                    if (ddlSerContractor.Items.Count == 2)
                    {
                        ddlSerContractor.SelectedIndex = 1;
                    }
                    ddlSerContractor.Visible        = false; // Added by Mukesh  as on 24 Jun 2015
                    lblASCShowHide.Visible          = false;
                    TrInvoiceHideShow.Visible       = false;
                    chkServicetaxoption.Visible     = false;
                    lblServiceChargesBracks.Visible = false;
                    ShowHideInvoiceDate.Visible     = false;
                }
                else
                {
                    UserMaster objUserMaster = new UserMaster();
                    objUserMaster.BindUseronUserName(Membership.GetUser().UserName.ToString(), "SELECT_USER_BY_USRNAME");
                    trRB.Visible = false;
                    ddlSerContractor.Items.Clear();
                    ddlSerContractor.Items.Add(new ListItem(objUserMaster.Name.ToString()));
                    ddlSerContractor.SelectedIndex = 0;
                    ddlSerContractor.Enabled       = false;
                    ddlSerContractor.Visible       = true; // Added by Mukesh  as on 24 Jun 2015
                    lblASCShowHide.Visible         = true;
                    TrInvoiceHideShow.Visible      = true;
                    //by @VT 09 Aug 2017
                    //InvoiceDetails();
                }
            }

            else
            {
                Response.Redirect("~/Pages/Default.aspx");
            }
            ddlMonth.SelectedValue = Convert.ToString(DateTime.Now.Month - 1);
        }
        // ddlMonth.SelectedValue = Convert.ToString(DateTime.Now.Month - 1);
        if (Convert.ToInt32(ddlMonth.SelectedValue) > 0)
        {
            lblMnth.Text = mfi.GetMonthName(Convert.ToInt32(ddlMonth.SelectedValue)).ToString() + " " + Ddlyear.SelectedValue;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        objCommonMIS.EmpId = Membership.GetUser().UserName.ToString();
        if (!Page.IsPostBack)
        {
            ViewState["FirstRow"] = 1;
            ViewState["LastRow"]  = 10;
            ViewState["strOrder"] = "Complaint_Refno ASC";
            TimeSpan duration = new TimeSpan(0, 0, 0, 0);
            txtFromDate.Text = DateTime.Now.Add(duration).ToShortDateString();
            txtToDate.Text   = DateTime.Now.Add(duration).ToShortDateString();
            // Added By Gaurav Garg on 18 Nov for MTO
            objCommonMIS.GetUserBusinessLine(ddlBusinessLine);

            //added By Gaurav Garg For MTO
            if (ddlBusinessLine.Items.Count != 0)
            {
                objCommonMIS.BusinessLine_Sno = ddlBusinessLine.SelectedValue;
            }
            else
            {
                objCommonMIS.BusinessLine_Sno = "0";
            }
            // END

            //Code Added By Vijai//////////////
            objCommonMIS.GetUserRegionsMTS_MTO(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.GetUserProductDivisions(ddlProductDivison);
            if (ddlProductDivison.Items.Count == 2)
            {
                ddlProductDivison.SelectedIndex = 1;
            }
            ddlProductDivison_SelectedIndexChanged(ddlProductDivison, null);   // bhawesh 4 apr 12
            //Add Guarav-30-11-2009
            if (ddlBusinessLine.SelectedValue == "2")
            {
                trResolvertype.Visible = false;
                divSC.Visible          = true;
                //trResolvertype.Visible = false;
                ddlResolver.SelectedIndex      = 0;
                ddlSerContractor.SelectedIndex = 0;
                trCGExce.Visible               = false;
                ddlCGExec.SelectedIndex        = 0;
                trCgContractEmp.Visible        = false;
                ddlCGContractEmp.SelectedIndex = 0;
            }
            else
            {
                trResolvertype.Visible = true;
                divSC.Visible          = false;
                //trResolvertype.Visible = true;
                ddlResolver.SelectedIndex      = 0;
                ddlSerContractor.SelectedIndex = 0;
                trCGExce.Visible               = false;
                ddlCGExec.SelectedIndex        = 0;
                trCgContractEmp.Visible        = false;
                ddlCGContractEmp.SelectedIndex = 0;
            }

            //End
            objCommonMIS.GetUserSCs(ddlSerContractor);
            if (ddlSerContractor.Items.Count == 2)
            {
                ddlSerContractor.SelectedIndex = 1;
            }
            //Add By Binay-25-08-2010
            BindModeofReceiptDdl(ddlModeOfReceipt);
            //end
            //End By Vijai
            ViewState["Column"] = "Complaint_RefNo";
            ViewState["Order"]  = "ASC";
        }
        System.Threading.Thread.Sleep(int.Parse(ConfigurationManager.AppSettings["AjaxPleaseWaitTime"]));
    }
Пример #26
0
 protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e)
 {
     objCommonMIS.RegionSno = ddlRegion.SelectedValue;
     objCommonMIS.GetUserBranchs(ddlBranch);
 }