protected void grdInoffice_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Visit") { int rowindex = ((GridViewRow)((Button)e.CommandSource).NamingContainer).RowIndex; Button lbtn = (Button)grdInoffice.Rows[rowindex].FindControl("btnVisit"); string value = ((Label)grdInoffice.Rows[rowindex].FindControl("lblCustID")).Text; string onoff = ((Label)grdInoffice.Rows[rowindex].FindControl("lblonoff")).Text; Int32 ID = Convert.ToInt32(((Label)grdInoffice.Rows[rowindex].FindControl("lblID")).Text); Session["PatientID"] = value; //Update Start Time if session noot opened already if (!onoff.Equals("ON")) { obj = new DashboardManager(); Int32 j = obj.UpdateDashoard(ID, "STARTTIME", Convert.ToString(Session["UserCode"])); } if (value.Equals("0")) { Session["PatientID"] = value; Session["Operation"] = "New"; } else { //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); Session["PatientID"] = value; Session["Operation"] = "Edit"; } Server.Transfer("~/Screens/PatientMaster.aspx"); } else if (e.CommandName == "End") { int rowindex = ((GridViewRow)((Button)e.CommandSource).NamingContainer).RowIndex; Button lbtn = (Button)grdInoffice.Rows[rowindex].FindControl("btnVisit"); string value = ((Label)grdInoffice.Rows[rowindex].FindControl("lblCustID")).Text; string onoff = ((Label)grdInoffice.Rows[rowindex].FindControl("lblonoff")).Text; Int32 ID = Convert.ToInt32(((Label)grdInoffice.Rows[rowindex].FindControl("lblID")).Text); Session["PatientID"] = value; DashboardManager obj1 = new DashboardManager(); Int32 j = obj1.UpdateDashoard(Convert.ToInt32(Session["PatientID"]), "ENDTIME", Convert.ToString(Session["UserCode"])); //Adding history for patient in History tables j = new DietMasterManager().UpdateClientData(Convert.ToInt16(Session["PatientID"].ToString())); binddata(); } else { } }
protected void Page_Load(object sender, EventArgs e) { DietMaster objDietMaster = new DietMaster(); objDietMaster.Operation = 1; objDietMaster.CustomerID = 0; int i = 0; BusinessHelper <IDietMaster> .Use(DietMasterManager => { i = DietMasterManager.ModifyDietMaster(objDietMaster); }); }
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(); } }
private void btnUpdate_Click(object sender, EventArgs e) { DietMaster objDietMaster = PrepareDietMaster(); objDietMaster.Operation = 2; objDietMaster.CustomerID = PatientInfo.PatientID; int i = 0; BusinessHelper <IDietMaster> .Use(DietMasterManager => { i = DietMasterManager.ModifyDietMaster(objDietMaster); }); if (i == 1) { MessageBox.Show("Updated Successfully"); } else { MessageBox.Show("Updated Successfully"); } }
private void btnAdd_Click(object sender, EventArgs e) { DietMaster objDietMaster = PrepareDietMaster(); objDietMaster.Operation = 1; objDietMaster.CustomerID = 0; int i = 0; BusinessHelper <IDietMaster> .Use(DietMasterManager => { i = DietMasterManager.ModifyDietMaster(objDietMaster); }); if (i == 1) { MessageBox.Show("Added Successfully"); } else { MessageBox.Show("Added Successfully"); } /* * * //Add Customer Details * CustomerDetail objCustDetail = new CustomerDetail(); * //objCustDetail.CustomerID = Convert.ToInt32(txtPatientID.Text); * //objCustDetail.CustomerName = txtPatientName.Text; * //objCustDetail.CustomerAge = Convert.ToInt32(txtPatientAge.Text); * //objCustDetail.Gender=cmbGender.SelectedIndex; * //objCustDetail.DOB = Convert.ToDateTime(txtDOB.Text); * //objCustDetail.Address = txtAddress.Text; * //objCustDetail.Profession = cmbProfession.SelectedItem.ToString(); * //objCustDetail.Email = txtEmail.Text; * //objCustDetail.Contact = txtContact.Text; * //objCustDetail.PresentExercise = txtPresentExcercise.Text; * //objCustDetail.ExersizeActivity = txtExcerciseActivity.Text; * //objCustDetail.NatureOfActivity = cmbNatureOfActivity.SelectedItem.ToString(); * * objCustDetail.CustomerID = 0; * objCustDetail.CustomerName = "Prashant"; * objCustDetail.CustomerAge = 25; * objCustDetail.Gender = 0; * objCustDetail.DOB = Convert.ToDateTime("5/8/1989"); * objCustDetail.Address = "Wadala"; * objCustDetail.Profession = "Farming"; * objCustDetail.Email = "*****@*****.**"; * objCustDetail.Contact = "9867815161"; * objCustDetail.PresentExercise = "Yoga"; * objCustDetail.ExersizeActivity = "Padmasan"; * objCustDetail.NatureOfActivity = "a. Sedentary( little or no exercise)"; * * int i=0; * BusinessHelper<ICustomerDetail>.Use(CustomerDetailManager => * { * i=CustomerDetailManager.ModifyCustomerDetail(objCustDetail); * }); * int c = i; * * //Add Anthropometrics details * Anthropometrics objAnthropometrics = new Anthropometrics(); * objAnthropometrics.Operation = 1; * * //objAnthropometrics.CustomerID = 0; * //objAnthropometrics.MeasuredWeight = Convert.ToInt32(txtMeasuredWeight.Text); * //objAnthropometrics.MeasuredHeight = Convert.ToInt32(txtMeasuredHeight.Text); * //objAnthropometrics.IdealBodyWeight = Convert.ToInt32(txtIdealBodyWeight.Text); * //objAnthropometrics.CalculatedBMI = Convert.ToInt32(txtCalculatedBMI.Text); * //objAnthropometrics.BMICategory = cmbBMICategory.SelectedItem.ToString(); * //objAnthropometrics.MeasuredWaist=Convert.ToInt32(txtMeasuredWaist.Text); * //objAnthropometrics.WeightGainInMonth = Convert.ToInt32(txtWeightGainInLastOneMonth.Text); * //objAnthropometrics.WeightGainInSixMonth=Convert.ToInt32(txtWeightGainInLastSixMonths.Text); * //objAnthropometrics.WeightGainInYear = Convert.ToInt32(txtWeightGainInLastYear.Text); * //objAnthropometrics.WeightLossInMonth = Convert.ToInt32(txtWeightGainInLastOneMonth.Text); * //objAnthropometrics.WeightGainInSixMonth = Convert.ToInt32(txtWeighLossInLastSixMonths.Text); * //objAnthropometrics.WeightLossInYear = Convert.ToInt32(txtWeighLossInLastYear.Text); * //objAnthropometrics.NeckCircumference = Convert.ToInt32(txtNeckCircumference.Text); * //objAnthropometrics.MUAC = Convert.ToInt32(txtMUAC.Text); * //objAnthropometrics.BloodPressure = Convert.ToInt32(txtBloodPressure.Text); * * * //dummy Data * objAnthropometrics.AnthropometricID = 0; * objAnthropometrics.CustomerID = 0; * objAnthropometrics.MeasuredWeight = 0; * objAnthropometrics.MeasuredHeight = 0; * objAnthropometrics.IdealBodyWeight = 0; * objAnthropometrics.CalculatedBMI = 0; * objAnthropometrics.BMICategory = "Normal BMI"; * objAnthropometrics.MeasuredWaist = 0; * objAnthropometrics.WeightGainInMonth = 0; * objAnthropometrics.WeightGainInSixMonth = 0; * objAnthropometrics.WeightGainInYear = 0; * objAnthropometrics.WeightLossInMonth = 0; * objAnthropometrics.WeightGainInSixMonth = 0; * objAnthropometrics.WeightLossInYear = 0; * objAnthropometrics.NeckCircumference = 0; * objAnthropometrics.MUAC = 0; * objAnthropometrics.BloodPressure = 0; * * i = 0; * BusinessHelper<IAnthropometrics>.Use(AnthropometricsManager => * { * i = AnthropometricsManager.ModifyAnthropometrics(objAnthropometrics); * }); * * //Add BioChemical Details * * * */ }