Example #1
0
        private void BindCity()
        {
            try
            {
                CityMastDAL obj = new CityMastDAL();
                var         lst = obj.SelectCityCombo();
                obj = null;
                drpCityFrom.DataSource     = lst;
                drpCityFrom.DataTextField  = "City_Name";
                drpCityFrom.DataValueField = "City_Idno";
                drpCityFrom.DataBind();
                drpCityFrom.Items.Insert(0, new ListItem("--Select--", "0"));

                BindDropdownDAL obj2   = new BindDropdownDAL();
                var             ToCity = obj2.BindAllToCity();
                obj2 = null;

                ddlCity.DataSource     = ToCity;
                ddlCity.DataTextField  = "city_name";
                ddlCity.DataValueField = "city_idno";
                ddlCity.DataBind();
                ddlCity.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));
            }
            catch (Exception Ex)
            {
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.UrlReferrer == null)
            {
                base.AutoRedirect();
            }
            con = ApplicationFunction.ConnectionString();
            if (Request.QueryString["FTyp"] != null)
            {
                HidInvoiceTyp.Value = Convert.ToString(Request.QueryString["FTyp"]);
            }
            if (!Page.IsPostBack)
            {
                if (base.CheckUserRights(intFormId) == false)
                {
                    Response.Redirect("PermissionDenied.aspx");
                }
                if (base.View == false)
                {
                    lnkbtnPreview.Visible = false;
                }
                this.BindDateRange();
                ddlDateRange.SelectedIndex = 0;
                Int32 intYearIdno = Convert.ToInt32(ddlDateRange.SelectedValue);
                this.BindItems();

                this.BindParty();
                SetDate();
                if (Convert.ToString(Session["Userclass"]) == "Admin")
                {
                    CityMastDAL obj = new CityMastDAL();
                    var         lst = obj.SelectCityCombo();
                    obj = null;
                    drpBaseCity.DataSource     = lst;
                    drpBaseCity.DataTextField  = "City_Name";
                    drpBaseCity.DataValueField = "City_Idno";
                    drpBaseCity.DataBind();
                    drpBaseCity.Items.Insert(0, new ListItem("--Select--", "0"));
                }
                else
                {
                    this.BindCity(Convert.ToInt64(Session["UserIdno"]));
                }

                userpref();
                imgBtnExcel.Visible = false;
            }


            txtDateFrom.Attributes.Add("onkeypress", "return notAllowAnything(event);");
            txtDateTo.Attributes.Add("onkeypress", "return notAllowAnything(event);");

            HidFrmCityIdno.Value = drpBaseCity.SelectedValue;
            ddlDateRange.Focus();
            userpref();
        }
        private void BindCity()
        {
            CityMastDAL OBJCityStateBLL = new CityMastDAL();
            var         lst             = OBJCityStateBLL.SelectCityCombo();

            OBJCityStateBLL        = null;
            ddlCity.DataSource     = lst;
            ddlCity.DataTextField  = "City_Name";
            ddlCity.DataValueField = "City_Idno";
            ddlCity.DataBind();
            ddlCity.Items.Insert(0, new ListItem("< Choose City >", "0"));
        }
        private void BindCity()
        {
            CityMastDAL obj = new CityMastDAL();
            var         lst = obj.SelectCityCombo();

            obj = null;
            drpCityFrom.DataSource     = lst;
            drpCityFrom.DataTextField  = "City_Name";
            drpCityFrom.DataValueField = "City_Idno";
            drpCityFrom.DataBind();
            drpCityFrom.Items.Insert(0, new ListItem("--Select--", "0"));
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.UrlReferrer == null)
            {
                base.AutoRedirect();
            }
            if (!Page.IsPostBack)
            {
                if (base.CheckUserRights(intFormId) == false)
                {
                    Response.Redirect("PermissionDenied.aspx");
                }
                if (base.ADD == false)
                {
                    lnkbtnSave.Visible = false;
                }
                this.BindDateRange();
                this.BindCity();
                ddlDateRange.SelectedValue = Convert.ToString(base.UserDateRng);
                ddlDateRange.SelectedIndex = 0;
                ddlDateRange_SelectedIndexChanged(null, null);
                txtDateRate.Text = DateTime.Now.ToString("dd-MM-yyyy");
                this.BindLorryType();
                txtfrghtAmount.Attributes.Add("onkeypress", "return allowOnlyFloatNumber(event);");

                txtfrghtAmount.Attributes.Add("onChange", "SetNumFormt('" + txtfrghtAmount.ClientID + "')");

                if (Convert.ToString(Session["Userclass"]) == "Admin")
                {
                    CityMastDAL obj = new CityMastDAL();
                    var         lst = obj.SelectCityCombo();
                    obj = null;
                    drpBaseCity.DataSource     = lst;
                    drpBaseCity.DataTextField  = "City_Name";
                    drpBaseCity.DataValueField = "City_Idno";
                    drpBaseCity.DataBind();
                    drpBaseCity.Items.Insert(0, new ListItem("--Select--", "0"));
                }
                else
                {
                    this.BindCity(Convert.ToInt64(Session["UserIdno"]));
                }
                userpref();
                drpBaseCity.SelectedValue = Convert.ToString(base.UserFromCity);
            }
            HidFrmCityIdno.Value = drpBaseCity.SelectedValue;
            ddlDateRange.Focus();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.UrlReferrer == null)
     {
         base.AutoRedirect();
     }
     con = ApplicationFunction.ConnectionString();
     if (!Page.IsPostBack)
     {
         if (base.CheckUserRights(intFormId) == false)
         {
             Response.Redirect("PermissionDenied.aspx");
         }
         if (base.ADD == false)
         {
             lnkbtnSave.Visible = false;
         }
         if (Convert.ToString(Session["Userclass"]) == "Admin")
         {
             CityMastDAL obj = new CityMastDAL();
             var         lst = obj.SelectCityCombo();
             obj = null;
             drpBaseCity.DataSource     = lst;
             drpBaseCity.DataTextField  = "City_Name";
             drpBaseCity.DataValueField = "City_Idno";
             drpBaseCity.DataBind();
             drpBaseCity.Items.Insert(0, new ListItem("--Select--", "0"));
         }
         else
         {
             this.BindCity(Convert.ToInt64(Session["UserIdno"]));
         }
         this.BindDateRange();
         ddlDateRange.SelectedIndex = 0;
         hidsave.Value = "0";
         // ddlDateRange_SelectedIndexChanged(null, null);
         Int32 intYearIdno = Convert.ToInt32(ddlDateRange.SelectedValue);
         txtDateRate.Text = DateTime.Now.ToString("dd-MM-yyyy");
         this.BindItems();
         BindState();
         txtCommsision.Enabled = true;
         userpref();
         drpBaseCity.SelectedValue = Convert.ToString(iFromCity);
         txtDateRate.Attributes.Add("onkeypress", "return notAllowAnything(event);");
         txtCommsision.Attributes.Add("onkeypress", "return allowOnlyFloatNumber(event);");
     }
 }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.UrlReferrer == null)
            {
                base.AutoRedirect();
            }
            con = ApplicationFunction.ConnectionString();
            if (Request.QueryString["FTyp"] != null)
            {
                HidInvoiceTyp.Value = Convert.ToString(Request.QueryString["FTyp"]);
            }
            if (!Page.IsPostBack)
            {
                //if (base.CheckUserRights(intFormId) == false)
                //{
                //    Response.Redirect("PermissionDenied.aspx");
                //}
                //if (base.ADD == false)
                //{
                //    lnkbtnSave.Visible = false;
                //}
                this.BindDateRange();
                this.BindTranType();
                ddlDateRange.SelectedValue = Convert.ToString(base.UserDateRng);
                ddlDateRange.SelectedIndex = 0;
                Int32 intYearIdno = Convert.ToInt32(ddlDateRange.SelectedValue);
                //txtDateRate.Text = DateTime.Now.ToString("dd-MM-yyyy");
                this.BindItems();
                this.BindCity();
                this.BindViaCity();
                this.BindParty();
                if (Convert.ToString(Session["Userclass"]) == "Admin")
                {
                    CityMastDAL obj = new CityMastDAL();
                    var         lst = obj.SelectCityCombo();
                    obj = null;
                    drpBaseCity.DataSource     = lst;
                    drpBaseCity.DataTextField  = "City_Name";
                    drpBaseCity.DataValueField = "City_Idno";
                    drpBaseCity.DataBind();
                    drpBaseCity.Items.Insert(0, new ListItem("--Select--", "0"));
                }
                else
                {
                    this.BindCity(Convert.ToInt64(Session["UserIdno"]));
                }

                userpref();
                //if (IsWeight == true)
                //{
                //    txt_Weight.Visible = true;
                //    rfv_Weight.Enabled = true;
                //    lblWeight.Visible = true;
                //}
                //else
                //{
                //    txt_Weight.Visible = false;
                //    lblWeight.Visible = false;
                //    rfv_Weight.Enabled = false;
                //}
                drpBaseCity.SelectedValue = Convert.ToString(base.UserFromCity);
            }


            if (Request.QueryString["RateIdno"] != null)
            {
                //Populate(Convert.ToInt32(Request.QueryString["RateIdno"]));
            }
            txtDateRate.Attributes.Add("onkeypress", "return notAllowAnything(event);");
            txtItemRate.Attributes.Add("onkeypress", "return allowOnlyFloatNumber(event);");
            txt_Weight.Attributes.Add("onkeypress", "return allowOnlyFloatNumber(event);");
            txtItemRate.Attributes.Add("onChange", "SetNumFormt('" + txtItemRate.ClientID + "')");
            txt_Weight.Attributes.Add("onChange", "SetNumFormt('" + txtItemRate.ClientID + "')");
            HidFrmCityIdno.Value = drpBaseCity.SelectedValue;
            ddlDateRange.Focus();
            userpref();
            //if (IsWeight == true)
            //{
            //    txt_Weight.Visible = true;
            //    rfv_Weight.Enabled = true;
            //    lblWeight.Visible = true;
            //}
            //else
            //{
            //    txt_Weight.Visible = false;
            //    lblWeight.Visible = false;
            //    rfv_Weight.Enabled = false;
            //}
        }