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();
         txtfreight.Attributes.Add("onChange", "SetNumFormt('" + txtfreight.ClientID + "')");
         txtadvance.Attributes.Add("onChange", "SetNumFormt('" + txtadvance.ClientID + "')");
         txtnetamnt.Attributes.Add("onChange", "SetNumFormt('" + txtnetamnt.ClientID + "')");
         txtothercharges.Attributes.Add("onChange", "SetNumFormt('" + txtothercharges.ClientID + "')");
         this.BindLorry();
         txtslipdate.Text = DateTime.Now.ToString("dd-MM-yyyy");
         SetDate();
         if (Request.QueryString["Lh"] != null)
         {
             Populate(Convert.ToInt32(Request.QueryString["Lh"]));
             PrintLorryHire(Convert.ToInt32(Request.QueryString["Lh"]));
             lnkBtnNew.Visible   = true;
             lnkbtnPrint.Visible = true;
         }
         else
         {
             lnkBtnNew.Visible   = false;
             lnkbtnPrint.Visible = false;
         }
         if (Convert.ToString(Session["Userclass"]) == "Admin")
         {
             LorryHireDAL obj = new LorryHireDAL();
             var          lst = obj.SelectCityCombo();
             obj = null;
             ddlFromCity.DataSource     = lst;
             ddlFromCity.DataTextField  = "City_Name";
             ddlFromCity.DataValueField = "City_Idno";
             ddlFromCity.DataBind();
             ddlFromCity.Items.Insert(0, new ListItem("--Select--", "0"));
         }
         else
         {
             //this.BindCity(Convert.ToInt64(Session["UserIdno"]));
         }
     }
     ddlDateRange.Focus();
 }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.UrlReferrer == null)
     {
         base.AutoRedirect();
     }
     if (!Page.IsPostBack)
     {
         if (base.Print == false)
         {
             imgBtnExcel.Visible = false;
         }
         this.BindDateRange();
         this.BindLorry();
         ddlDateRange_SelectedIndexChanged(null, null);
         txtdatefrom.Attributes.Add("onkeypress", "return notAllowAnything(event);");
         txtdateto.Attributes.Add("onkeypress", "return notAllowAnything(event);");
         if (Convert.ToString(Session["Userclass"]) == "Admin")
         {
             LorryHireDAL obj = new LorryHireDAL();
             var          lst = obj.SelectCityCombo();
             obj = null;
             ddlFromCity.DataSource     = lst;
             ddlFromCity.DataTextField  = "City_Name";
             ddlFromCity.DataValueField = "City_Idno";
             ddlFromCity.DataBind();
             ddlFromCity.Items.Insert(0, new ListItem("--Select--", "0"));
         }
         else
         {
             //this.BindCity(Convert.ToInt64(Session["UserIdno"]));
         }
         Countalllorryslip();
         ddlDateRange.Focus();
     }
 }