protected void rptAlphabets_ItemCreated(object sender, RepeaterItemEventArgs e)
    {
        LinkButton btn = e.Item.FindControl("lnkAlphabet") as LinkButton;

        if (btn != null)
        {
            Toolkit1.RegisterAsyncPostBackControl(btn);
        }
    }
    //protected void txtEmail_TextChanged(object sender, EventArgs e)
    //{
    //    //BusinessHelper<IDietMaster>.Use(DietMasterManager =>
    //    //{
    //    //    dtSearchMaster = DietMasterManager.SearchPatients(txtName.Text.Trim(), "NAME");
    //    //});
    //    txtID.Text = "";
    //    txtName.Text = "";
    //    txtContact.Text = "";
    //    dtSearchMaster = master.SearchPatients(txtEmail.Text.Trim(), "EMAIL");
    //    grdPatients.DataSource = dtSearchMaster;
    //    grdPatients.DataBind();
    //}
    //protected void txtContact_TextChanged(object sender, EventArgs e)
    //{

    //    //BusinessHelper<IDietMaster>.Use(DietMasterManager =>
    //    //{
    //    //    dtSearchMaster = DietMasterManager.SearchPatients(txtID.Text.Trim(), "ID");
    //    //});
    //    // DietMasterManager.SearchPatients(txtID.Text.Trim(), "ID");
    //    txtName.Text = "";
    //    txtID.Text = "";
    //    txtEmail.Text = "";
    //    dtSearchMaster = master.SearchPatients(txtContact.Text.Trim(), "CONTACT");
    //    grdPatients.DataSource = dtSearchMaster;
    //    grdPatients.DataBind();

    //}

    protected void grdPatients_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            LinkButton b = (LinkButton)e.Row.FindControl("btnView");
            //LinkButton b1 = (LinkButton)e.Row.FindControl("btnVisit");
            Toolkit1.RegisterPostBackControl(b);
            //Toolkit1.RegisterPostBackControl(b1);
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     Toolkit1.RegisterAsyncPostBackControl(btnFollowupQuestionsSave);
     if (!IsPostBack)
     {
         if (Session["PatientID"] == null || Convert.ToString(Session["PatientID"]).Equals("0"))
         {
             Tell.Alert("Info", "Patient Id not found!!", this);
         }
         else
         {
             bind();
         }
         gridBind();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     //Session["UserCode"] = "SUPERADMIN";
     Toolkit1.RegisterPostBackControl(btnNew);
     if (!IsPostBack)
     {
         //BusinessHelper<IDietMaster>.Use(DietMasterManager =>
         //{
         //    dtSearchMaster = DietMasterManager.SearchPatients("", "ALL");
         //});
         ViewState["Alphabet"] = "A";
         this.GenerateAlphabets();
         dtSearchMaster         = master.SearchPatients("A", "NAME", Convert.ToString(Session["UserCode"]));
         grdPatients.DataSource = dtSearchMaster;
         grdPatients.DataBind();
         Session["PatientID"] = 0;
         Session["Operation"] = "";
     }
 }
Beispiel #5
0
        protected void grdScheduled_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Button btn = ((Button)e.Row.FindControl("btnMark"));
                Toolkit1.RegisterAsyncPostBackControl(btn);
                btn = ((Button)e.Row.FindControl("btnView"));
                Toolkit1.RegisterAsyncPostBackControl(btn);


                DataRowView drview = e.Row.DataItem as DataRowView;
                //   dt = DateTime.ParseExact(drview[4].ToString(), "h:mmtt", CultureInfo.InvariantCulture);
                Label l = ((Label)e.Row.FindControl("lblDiff"));
                if (Convert.ToString(new HelperMasterDataManager().CheckAccess(Convert.ToString(Session["UserCode"])).Rows[0][0]).Equals("TRUE"))
                {
                    ((Button)e.Row.FindControl("btnMark")).Visible  = true;
                    ((Button)e.Row.FindControl("btnMark")).CssClass = "btn btn-info";
                    ((Button)e.Row.FindControl("btnView")).Visible  = true;
                    ((Button)e.Row.FindControl("btnView")).Enabled  = true;
                    if (Convert.ToInt32(l.Text) < 0)
                    {
                        ((Button)e.Row.FindControl("btnView")).Text     = Math.Abs(Convert.ToInt32(l.Text)).ToString() + " mins late";
                        ((Button)e.Row.FindControl("btnView")).CssClass = "btn btn-danger disabled cur";
                        ////((Button)e.Row.FindControl("btnView")).Enabled = false;
                        //((Button)e.Row.FindControl("btnView")).ForeColor = System.Drawing.Color.White ;
                    }
                    else
                    {
                        //TimeSpan span = DateTime.UtcNow.AddHours(5.5).Subtract(dt);
                        ((Button)e.Row.FindControl("btnView")).Text     = "Appt in " + l.Text + " mins";
                        ((Button)e.Row.FindControl("btnView")).CssClass = "btn btn-info disabled cur";
                        ////((Button)e.Row.FindControl("btnView")).Enabled = false;
                        //((Button)e.Row.FindControl("btnView")).ForeColor = System.Drawing.Color.White;
                    }
                }
                else
                {
                    ((Button)e.Row.FindControl("btnMark")).CssClass = "btn btn-info";
                    ((Button)e.Row.FindControl("btnMark")).Visible  = true;
                    ((Button)e.Row.FindControl("btnView")).Visible  = false;
                }
            }
        }
    protected void on_row(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "View")
        {
            int        rowindex = ((GridViewRow)((LinkButton)e.CommandSource).NamingContainer).RowIndex;
            LinkButton lbtn     = (LinkButton)grdPatients.Rows[rowindex].FindControl("btnView");
            Toolkit1.RegisterPostBackControl(lbtn);
            string value = ((Label)grdPatients.Rows[rowindex].FindControl("lblID")).Text;
            Session["PatientID"] = value;
            Session["Operation"] = "Edit";
            Server.Transfer("~/Screens/PatientMaster.aspx");
        }
        if (e.CommandName == "Visit")
        {
            int        rowindex = ((GridViewRow)((LinkButton)e.CommandSource).NamingContainer).RowIndex;
            LinkButton lbtn     = (LinkButton)grdPatients.Rows[rowindex].FindControl("btnVisit");
            Toolkit1.RegisterPostBackControl(lbtn);
            string value = ((Label)grdPatients.Rows[rowindex].FindControl("lblID")).Text;
            Session["PatientID"] = value;
            master = new DietMasterManager();

            Int32 i = master.UpdateClientData(Convert.ToInt16(Session["PatientID"].ToString()));
            if (i == 1)
            {
                Tell.text("Marked as visit successfully!!", this);
            }
            else if (i == -1)
            {
                Tell.text("Visit already marked today!!", this);
            }
            else
            {
                Tell.text("Visit not marked !!", this);
            }

            dtSearchMaster         = master.SearchPatients("", "ALL", Convert.ToString(Session["UserCode"]));
            grdPatients.DataSource = dtSearchMaster;
            grdPatients.DataBind();
        }
    }
Beispiel #7
0
        protected void grdInoffice_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            //DateTime dt;
            ////DateTime dt1;
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Button btn = ((Button)e.Row.FindControl("btnVisit"));
                Toolkit1.RegisterPostBackControl(btn);
                btn = ((Button)e.Row.FindControl("btnEnd"));
                Toolkit1.RegisterAsyncPostBackControl(btn);


                Label l = ((Label)e.Row.FindControl("lblonoff"));
                if (Convert.ToString(new HelperMasterDataManager().CheckAccess(Convert.ToString(Session["UserCode"])).Rows[0][0]).Equals("TRUE"))
                {
                    ((Button)e.Row.FindControl("btnVisit")).Enabled             = true;
                    ((Button)e.Row.FindControl("btnVisit")).CssClass            = "btn btn-danger";
                    ((Button)e.Row.FindControl("btnEnd")).Enabled               = true;
                    ((Button)e.Row.FindControl("btnEnd")).Attributes["Onclick"] = "return confirm('Are you sure you want to end appointment?')";
                    ((Button)e.Row.FindControl("btnEnd")).CssClass              = "btn btn-success";
                }
                else
                {
                    ((Button)e.Row.FindControl("btnVisit")).Enabled  = false;
                    ((Button)e.Row.FindControl("btnEnd")).Enabled    = false;
                    ((Button)e.Row.FindControl("btnEnd")).CssClass   = "btn btn-success disabled cur";
                    ((Button)e.Row.FindControl("btnVisit")).CssClass = "btn btn-danger disabled cur";
                }
                if (l.Text.Equals("ON"))
                {
                    ((Button)e.Row.FindControl("btnVisit")).Text = "Session in progress";
                }
                else
                {
                    ((Button)e.Row.FindControl("btnEnd")).Enabled  = false;
                    ((Button)e.Row.FindControl("btnEnd")).CssClass = "btn btn-success disabled cur";
                }
            }
        }