Esempio n. 1
0
        protected void frmvwAddUpdateLiverFunction_ItemCommand(object sender, FormViewCommandEventArgs e)
        {
            #region Controls
            TextBox txtTestDate      = (TextBox)frmvwAddUpdateLiverFunction.FindControl("txtTestDate");
            TextBox txtSBilirubin    = (TextBox)frmvwAddUpdateLiverFunction.FindControl("txtSBilirubin");
            TextBox txtSGOT          = (TextBox)frmvwAddUpdateLiverFunction.FindControl("txtSGOT");
            TextBox txtSGPT          = (TextBox)frmvwAddUpdateLiverFunction.FindControl("txtSGPT");
            TextBox txtGGT           = (TextBox)frmvwAddUpdateLiverFunction.FindControl("txtGGT");
            TextBox txtSAlkPhosphate = (TextBox)frmvwAddUpdateLiverFunction.FindControl("txtSAlkPhosphate");
            TextBox txtSProtein      = (TextBox)frmvwAddUpdateLiverFunction.FindControl("txtSProtein");
            TextBox txtAlbumin       = (TextBox)frmvwAddUpdateLiverFunction.FindControl("txtAlbumin");
            TextBox txtGlobulin      = (TextBox)frmvwAddUpdateLiverFunction.FindControl("txtGlobulin");
            TextBox txtAGRatio       = (TextBox)frmvwAddUpdateLiverFunction.FindControl("txtAGRatio");
            #endregion

            if (e.CommandName == "AddLiverFunction")
            {
                DC_Message _msg = new DC_Message();
                DC_LiverFunctionReports _objAdd = new DC_LiverFunctionReports();
                _objAdd.TestDate      = Convert.ToDateTime(txtTestDate.Text);
                _objAdd.PatientID     = GetPatientID();
                _objAdd.SBilirubin    = txtSBilirubin.Text;
                _objAdd.SGOT          = txtSGOT.Text;
                _objAdd.SGPT          = txtSGPT.Text;
                _objAdd.GGT           = txtGGT.Text;
                _objAdd.SAlkPhosphate = txtSAlkPhosphate.Text;
                _objAdd.SProtein      = txtSProtein.Text;
                _objAdd.Albumin       = txtAlbumin.Text;
                _objAdd.Globulin      = txtGlobulin.Text;
                _objAdd.AGRatio       = txtAGRatio.Text;
                _objAdd.CreatedBy     = "Ajay";
                _objAdd.CreatedDate   = DateTime.Today;
                _msg = _objDL.AddUpdateLiverFunReports(_objAdd);
                if (_msg.StatusCode == ReadOnlyMessage.StatusCode.Success)
                {
                    BootstrapAlert.BootstrapAlertMessage(divmsg, _msg.StatusMessage, BootstrapAlertType.Success);
                    frmvwAddUpdateLiverFunction.ChangeMode(FormViewMode.Insert);
                    BindGridDetails();
                }
            }
            if (e.CommandName == "UpdateLiverFunction")
            {
                DC_Message _msg = new DC_Message();
                DC_LiverFunctionReports _objAdd = new DC_LiverFunctionReports();
                _objAdd.LFR_TestReportID = Guid.Parse(Convert.ToString(frmvwAddUpdateLiverFunction.DataKey.Value));
                _objAdd.TestDate         = Convert.ToDateTime(txtTestDate.Text);
                _objAdd.SBilirubin       = txtSBilirubin.Text;
                _objAdd.SGOT             = txtSGOT.Text;
                _objAdd.SGPT             = txtSGPT.Text;
                _objAdd.GGT           = txtGGT.Text;
                _objAdd.SAlkPhosphate = txtSAlkPhosphate.Text;
                _objAdd.SProtein      = txtSProtein.Text;
                _objAdd.Albumin       = txtAlbumin.Text;
                _objAdd.Globulin      = txtGlobulin.Text;
                _objAdd.AGRatio       = txtAGRatio.Text;
                _objAdd.EditedBy      = "Ajay";
                _objAdd.EditedDate    = DateTime.Today;
                _msg = _objDL.AddUpdateLiverFunReports(_objAdd);
                if (_msg.StatusCode == ReadOnlyMessage.StatusCode.Success)
                {
                    BootstrapAlert.BootstrapAlertMessage(divmsg, _msg.StatusMessage, BootstrapAlertType.Success);
                    frmvwAddUpdateLiverFunction.ChangeMode(FormViewMode.Insert);
                    BindGridDetails();
                }
            }
        }