Exemplo n.º 1
0
 private void viewdata()
 {
     try
     {
         DataTable dt1 = new DataTable();
         objBE.Action         = "R";
         objBE.UserName       = Session["UsrName"].ToString();
         dt1                  = objDist.SchemeMst_IUDR_BAL(objBE, ConnKey);
         GridView1.DataSource = dt1;
         GridView1.DataBind();
         if (dt1.Rows.Count > 0)
         {
             GridView1.HeaderRow.Cells[0].Attributes["data-class"] = "expand";
             GridView1.HeaderRow.Cells[1].Attributes["data-hide"]  = "phone";
             GridView1.HeaderRow.Cells[2].Attributes["data-hide"]  = "phone";
             GridView1.HeaderRow.Cells[3].Attributes["data-hide"]  = "phone";
             //   GridView1.HeaderRow.Cells[4].Attributes["data-hide"] = "phone";
             GridView1.HeaderRow.TableSection = TableRowSection.TableHeader;
         }
     }
     catch (Exception ex)
     {
         ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString());
         Response.Redirect("~/Error.aspx");
     }
 }
Exemplo n.º 2
0
 private void BindSchemes()
 {
     try
     {
         DataTable dt1 = new DataTable();
         objBE.Action = "S";
         dt1          = objMst.SchemeMst_IUDR_BAL(objBE, ConnKey);
         objCommon.BindDropDownLists(ddlScheme, dt1, "SchemeName", "SchemeCode", "0");
     }
     catch (Exception ex)
     {
         ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString());
         Response.Redirect("~/Error.aspx");
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == ""))
        {
            Response.Redirect("~/Error.aspx");
        }
        else
        {
            string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim();
            string http_hos = Request.ServerVariables["HTTP_HOST"].Trim();
            int    len      = http_hos.Length;
            if (http_ref.IndexOf(http_hos, 0) < 0)
            {
                Response.Redirect("~/Error.aspx");
            }
        }

        if (Session["Role"].ToString() == null || Session["Role"].ToString() != "3")
        {
            Response.Redirect("~/Error.aspx");
        }
        lblUsrName.Text = Session["UsrName"].ToString();
        lblDate.Text    = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year;
        StateCode       = Session["StateCd"].ToString();
        UserName        = Session["UsrName"].ToString();
        ConnKey         = Session["ConnStr"].ToString();
        if (!IsPostBack)
        {
            try
            {
                imgstate.ImageUrl = "~/img/" + Session["statecd"].ToString().Trim() + ".png";
                lblstatename.Text = "GOVERNMENT OF " + Session["statename"].ToString();
                ddt = objPhar.getdrug(ConnKey);
                objCommon.BindDropDownLists(ddl_Drug, ddt, "DrugName", "DrugCode", "0");

                ddt = objPhar.getsuply(ConnKey);
                objCommon.BindDropDownLists(ddl_Suply, ddt, "SupplierName", "SupplierCode", "0");

                objBE.Action = "S";
                ddt          = objMst.SchemeMst_IUDR_BAL(objBE, ConnKey);
                objCommon.BindDropDownLists(ddlScheme, ddt, "SchemeName", "SchemeCode", "0");


                btn_Update.Visible = false;
                Viewdata();

                GetInsNameBAL();
                GetYear();

                for (int month = 1; month <= 12; month++)
                {
                    string monthName = DateTimeFormatInfo.CurrentInfo.GetMonthName(month);
                    ddl_Month.Items.Add(new ListItem(monthName, month.ToString().PadLeft(2, '0')));
                }
            }
            catch (Exception ex)
            {
                ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString());
                Response.Redirect("~/Error.aspx");
            }
            // Calendar1.StartDate = DateTime.Now;   //to dissable past Date
        }

        //ExCalender.StartDate = DateTime.Now;
    }