Пример #1
0
    protected void lnkDelete_Click(object sender, EventArgs e)
    {
        DBHelperClass db = new DBHelperClass();

        try
        {
            LinkButton lnkdelete = sender as LinkButton;
            string     SP        = "delete from tbl_designation where id=" + lnkdelete.CommandArgument;



            int val = db.executeQuery(SP);

            if (val > 0)
            {
                bindGroupsDetails(1);
                divSuccess.Attributes.Add("style", "display:block");
                divfail.Attributes.Add("style", "display:none");
            }
            else
            {
                divSuccess.Attributes.Add("style", "display:none");
                divfail.Attributes.Add("style", "display:block");
            }
        }
        catch (Exception ex)
        {
            log.Error(ex.Message);
        }
    }
Пример #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (fup.HasFiles)
            {
                string upload_folder_path = "~/PatientDocument/" + Session["PatientId"];

                if (!Directory.Exists(upload_folder_path))
                {
                    Directory.CreateDirectory(Server.MapPath(upload_folder_path));
                }


                foreach (HttpPostedFile uploadedFile in fup.PostedFiles)
                {
                    string filename = uploadedFile.FileName;
                    string doa      = CommonConvert.DateFormat(ViewState["doa"].ToString());
                    //string filename = System.DateTime.Now.Millisecond.ToString() + "_" + uploadedFile.FileName;
                    string query = "insert into tblPatientDocument values('" + filename + "','" + System.DateTime.Now.ToString() + "','" + upload_folder_path + "/" + filename + "'," + Session["PatientId"].ToString() + ",'" + Request["DOA"].ToString() + "')";
                    db.executeQuery(query);

                    uploadedFile.SaveAs(System.IO.Path.Combine(Server.MapPath(upload_folder_path), filename));
                    // listofuploadedfiles.Text += String.Format("{0}<br />", uploadedFile.FileName);
                }
            }
            getData();
        }
        catch (Exception ex)
        {
        }
    }
Пример #3
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        DBHelperClass db = new DBHelperClass();

        try
        {
            string         SP    = "";
            SqlParameter[] param = null;

            if (Request["id"] != null)
            {
                param = new SqlParameter[10];
                SP    = "update tbl_designation set Designation='" + txtDesignation.Text + "' where id=" + Request["id"];
            }
            else
            {
                param = new SqlParameter[10];
                SP    = "insert into tbl_designation values('" + txtDesignation.Text + "')";
            }
            int val = db.executeQuery(SP);

            if (val > 0)
            {
                Response.Redirect("ViewDesignation.aspx");
            }
        }
        catch (Exception ex)
        {
        }
    }
Пример #4
0
    public void Reschedules(string id)
    {
        DBHelperClass dBHelper = new DBHelperClass();
        string        query    = "update tblProceduresDetail set Scheduled=null where ProcedureDetail_ID=" + id;

        dBHelper.executeQuery(query);
        BindProcudureList();
    }
Пример #5
0
 public void TransferToExecute(string id, string sDate)
 {
     if (!string.IsNullOrEmpty(sDate))
     {
         DBHelperClass dBHelper = new DBHelperClass();
         string        query    = "update tblProceduresDetail set Executed='" + sDate + "',Scheduled=null where ProcedureDetail_ID=" + id;
         dBHelper.executeQuery(query);
     }
 }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        DBHelperClass db    = new DBHelperClass();
        Button        btn   = sender as Button;
        string        query = "delete from tblPatientDocument where Document_ID=" + btn.CommandArgument;

        db.executeQuery(query);
        getData();
    }
Пример #7
0
    protected void btnSignUpload_Click(object sender, EventArgs e)
    {
        foreach (HttpPostedFile postedFile in fupsign.PostedFiles)
        {
            //string[] fileName = Path.GetFileName(postedFile.FileName).Split(',');
            string fileName = Path.GetFileName(postedFile.FileName);
            string msg      = "";
            try
            {
                string upload_folder_path = "~/Sign/";
                string fullpath           = System.IO.Path.Combine(Server.MapPath(upload_folder_path), fileName);

                postedFile.SaveAs(fullpath);

                sb.Append("<p>File Name : " + fileName + "  patientIEId:" + fileName.Split('_')[0] + "     Status : Uploaded </p>");
                sb.Append(Environment.NewLine);
                Logger.Info("File Name : " + fileName + "  patientIEId:" + fileName.Split('_')[0] + "     Status : Uploaded");
                string query = "";
                if (!string.IsNullOrEmpty(fileName.Split('_')[0]))
                {
                    query = "delete from tblPatientIESign where PatientIE_ID=" + fileName.Split('_')[0];


                    db.executeQuery(query);
                    query = "insert into tblPatientIESign values(" + fileName.Split('_')[0] + ",'" + fullpath + "',null,null,getdate(),0)";
                    db.executeQuery(query);
                }
            }
            catch (Exception ex)
            {
                sb.Append("<p style='color:red'>File Name : " + fileName + "     Status : Not Uploaded </p>");
                Logger.Error("File Name : " + fileName + "       Status : Not Uploaded \n");
            }
        }
        lblResult.InnerHtml = sb.ToString();
    }
Пример #8
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string        query = "select Password from tblUserMaster where (LoginID=@uname or eMailID=@uname)";
        SqlConnection cn    = new SqlConnection(ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString);

        SqlCommand cm = new SqlCommand(query, cn);

        cm.Parameters.AddWithValue("@uname", txt_uname.Text);


        SqlDataAdapter da = new SqlDataAdapter(cm);
        DataSet        ds = new DataSet();

        da.Fill(ds);

        if (ds.Tables[0].Rows.Count > 0)
        {
            if (ds.Tables[0].Rows[0]["Password"].ToString() == txt_pass.Text)
            {
                //Change the password and redirect next page
                DBHelperClass db = new DBHelperClass();

                query = "UPDATE tblUserMaster SET Password = '******' WHERE LoginID = '" + txt_uname.Text.ToString() + "'";

                int val = db.executeQuery(query);

                if (val > 0)
                {
                    Session["uname"]     = txt_uname.Text;
                    lblMessage.InnerHtml = "Password has been changed successfuly.";
                    lblMessage.Attributes.Add("style", "color:green");
                    upMessage.Update();
                    ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString(), "openPopup('mymodelmessage')", true);
                    Response.Redirect("PatientIntakeList.aspx");
                }
            }
            else
            {
                lblmess.Attributes.Add("style", "display:block");
            }
        }
        else
        {
            lblmess.Attributes.Add("style", "display:block");
        }
    }
Пример #9
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        DBHelperClass db = new DBHelperClass();

        try
        {
            string query = "", strmcode = "", position = "";


            for (int i = 0; i < chkProcExe.Items.Count; i++)
            {
                if (chkProcExe.Items[i].Selected)
                {
                    strmcode = strmcode + "," + chkProcExe.Items[i].Text;
                }
            }

            if (ddlbodypart.SelectedValue.ToLower() != "neck" || ddlbodypart.SelectedValue.ToLower() != "midback" || ddlbodypart.SelectedValue.ToLower() != "lowback")
            {
                position = ddlposition.SelectedValue;
            }

            if (Request["id"] == null)
            {
                query = "insert into tblProcedureStatus values('" + ddlProcSchedule.SelectedValue + "','" + strmcode.TrimStart(',') + "','" + ddlbodypart.SelectedValue + "','" + position + "')";
            }
            else
            {
                query = " update tblProcedureStatus set Procedures='" + ddlProcSchedule.SelectedValue + "',PreRequest='" + strmcode.TrimStart(',') + "',BodyPart='" + ddlbodypart.SelectedValue + "',Position='" + ddlposition.SelectedValue + "' where id=" + Request["id"];
            }

            int val = db.executeQuery(query);
            if (val > 0)
            {
                Response.Redirect("ViewProcConstraint.aspx");
            }
        }
        catch (Exception ex)
        {
            log.Error(ex.Message);
        }
    }
Пример #10
0
    protected void lnkDelete_Click(object sender, EventArgs e)
    {
        DBHelperClass db = new DBHelperClass();

        try
        {
            LinkButton lnkdelete = sender as LinkButton;
            string     SP        = "delete from tblUserMaster where User_ID=" + lnkdelete.CommandArgument;

            db.executeQuery(SP);

            //if (val > 0)
            //{
            BindUserDetails(1);
            divSuccess.Attributes.Add("style", "display:block");
            divfail.Attributes.Add("style", "display:none");
        }
        catch (Exception ex)
        {
            divSuccess.Attributes.Add("style", "display:none");
            divfail.Attributes.Add("style", "display:block");
            log.Error(ex.Message);
        }
    }
Пример #11
0
    protected void btnupload_mul_Click(object sender, EventArgs e)
    {
        DBHelperClass dBHelperClass = new DBHelperClass();
        DataSet       dataSet = new DataSet();
        string        fname = "", lname = "", doa = "";


        foreach (HttpPostedFile postedFile in fupmul.PostedFiles)
        {
            //string[] fileName = Path.GetFileName(postedFile.FileName).Split(',');
            string fileName = Path.GetFileName(postedFile.FileName);
            string msg      = "";
            try
            {
                Regex re = new Regex(@"\d+");
                Match m  = re.Match(fileName);
                if (m.Success)
                {
                    string   file = fileName.Substring(0, m.Index);
                    string[] str  = file.Split(',');
                    // lblResults.Text = string.Format("RegEx found " + m.Value + " at position " + m.Index.ToString() + " character in string is " + file + " fname: " + str[1] + ",LastName:" + str[0]);
                    lname = str[0];

                    if (str[1].Contains("_"))
                    {
                        fname = str[1].Split('_')[0];
                    }
                    else
                    {
                        fname = str[1];
                    }

                    file = fileName;
                    str  = file.Split('_');
                    if (str.Length > 2)
                    {
                        doa = str[str.Length - 1].ToLower().Split('.')[0];
                    }
                }
                else
                {
                    string[] str = fileName.Split('_');
                    fname = str[0].Split(',')[1];
                    lname = str[0].Split(',')[0];
                }

                doa = CommonConvert.DateformatDOA(doa);
                doa = CommonConvert.DateFormat(doa);

                string[] strfname = fname.TrimStart().Split(' ');
                fname   = strfname[0];
                dataSet = dBHelperClass.selectData("select Patient_ID from tblPatientMaster where LastName='" + lname.Trim().TrimStart() + "' and FirstName='" + fname.Trim().TrimStart() + "'");

                if (dataSet != null && dataSet.Tables[0].Rows.Count > 0)
                {
                    string patientid = dataSet.Tables[0].Rows[0][0].ToString();

                    string upload_folder_path = "~/PatientDocument/" + patientid;

                    if (!Directory.Exists(upload_folder_path))
                    {
                        Directory.CreateDirectory(Server.MapPath(upload_folder_path));
                    }

                    postedFile.SaveAs(System.IO.Path.Combine(Server.MapPath(upload_folder_path), fileName));

                    sb.Append("<p>File Name : " + fileName + "  patientid:" + patientid + "     Status : Uploaded </p>");
                    sb.Append(Environment.NewLine);
                    Logger.Info("File Name : " + fileName + "  patientid:" + patientid + "     Status : Uploaded");

                    //string filename = System.DateTime.Now.Millisecond.ToString() + "_" + fileName;
                    if (checkName(fileName, patientid) == false)
                    {
                        string filename = fileName;
                        string query    = "insert into tblPatientDocument values('" + filename + "','" + System.DateTime.Now.ToString() + "','" + upload_folder_path + "/" + filename + "'," + patientid + ",'" + doa + "')";

                        dBHelperClass.executeQuery(query);
                    }
                }
                else
                {
                    sb.Append("<p style='color:red'> File Name : " + fileName + "     Status : Not Uploaded</p>");
                    sb.Append(Environment.NewLine);
                    Logger.Info("File Name : " + fileName + "     Status : Not Uploaded");
                }
            }
            catch (Exception ex)
            {
                sb.Append("<p style='color:red'>File Name : " + fileName + "     Status : Not Uploaded </p>");
                Logger.Error("File Name : " + fileName + "       Status : Not Uploaded \n");
            }
            lblResult.InnerHtml = sb.ToString();
        }
    }
Пример #12
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            DBHelperClass db    = new DBHelperClass();
            string        query = "";

            //query = "update  tblPatientIEDetailPage1 set FreeForm='" + txt_FreeForm.Text + "' where PatientIE_ID=" + Session["PatientIE_ID"].ToString();


            //int val = db.executeQuery(query);

            //if (val > 0)
            //{


            query = "select top 1 * from tblPatientIEDetailPage2 where PatientIE_ID=" + Session["PatientIE_ID"].ToString();
            DataSet ds = db.selectData(query);
            if (ds.Tables[0].Rows.Count == 0)
            {
                query = "insert into tblPatientIEDetailPage2 (";
                query = query + "intactexcept,LEdtr,DTRtricepsRight,DTRtricepsLeft,DTRBicepsRight,DTRBicepsLeft,DTRBrachioRight,DTRBrachioLeft,UEdtr,DTRKneeLeft,DTRKneeRight,DTRAnkleLeft,DTRAnkleRight,Sensory,PinPrick,Lighttouch,";
                query = query + "LEsen,LEL3Right,LEL3Left,LEL4Right,LEL4Left,LEL5Right,LEL5Left,LES1Left,LES1Right,LELumberParaspinalsLeft,LELumberParaspinalsRight,UEsen,UEC5Left,UEC5Right,UEC6Left,UEC6Right,UEC7Left,UEC7Right,UEC8Left,UEC8Right,UET1Right,UET1Left,UECervicalParaspinalsRight,UECervicalParaspinalsLeft,";
                query = query + "LEmmst,LEHipFlexionRight,LEHipFlexionLeft,LEHipAbductionRight,LEHipAbductionLeft,LEKneeExtensionRight,LEKneeExtensionLeft,LEKneeFlexionRight,LEKneeFlexionLeft,LEAnkleDorsiRight,LEAnkleDorsiLeft,LEAnklePlantarRight,LEAnklePlantarLeft,LEAnkleExtensorRight,LEAnkleExtensorLeft,";
                query = query + "UEmmst,UEShoulderAbductionRight,UEShoulderAbductionLeft,UEShoulderFlexionRight,UEShoulderFlexionLeft,UEElbowExtensionRight,UEElbowExtensionLeft,UEElbowFlexionRight,UEElbowFlexionLeft,UEElbowSupinationRight,UEElbowSupinationLeft,UEElbowPronationRight,UEElbowPronationLeft,UEWristFlexionRight,UEWristFlexionLeft,UEWristExtensionRight,UEWristExtensionLeft,UEHandGripStrengthRight,UEHandGripStrengthLeft,UEHandFingerAbductorsRight,UEHandFingerAbductorsLeft";
                query = query + ") values (";

                query = query + "'" + txtIntactExcept.Text + "','" + LEdtr.Checked + "','" + RTricepstxt.Text + "','" + LTricepstxt.Text + "','" + RBicepstxt.Text + "','" + LBicepstxt.Text + "','" + RBrachioradialis.Text + "','" + LBrachioradialis.Text + "','" + UExchk.Checked + "','" + LKnee.Text + "','" + RKnee.Text + "','" + LAnkle.Text + "','" + RAnkle.Text + "','" + txtSensory.Text.Replace("'", "''") + "','" + chkPinPrick.Checked + "','" + chkLighttouch.Checked + "',";
                query = query + "'" + LESen_Click.Checked + "','" + TextBox4.Text + "','" + txtDMTL3.Text + "','" + TextBox6.Text + "','" + TextBox5.Text + "','" + TextBox8.Text + "','" + TextBox7.Text + "','" + TextBox10.Text + "','" + TextBox21.Text + "','" + TextBox24.Text + "','" + TextBox25.Text + "','" + UESen_Click.Checked + "','" + TextBox9.Text + "','" + txtUEC5Right.Text + "','" + TextBox11.Text + "','" + TextBox12.Text + "','" + TextBox13.Text + "','" + TextBox14.Text + "','" + TextBox15.Text + "','" + TextBox16.Text + "','" + TextBox18.Text + "','" + TextBox17.Text + "','" + TextBox20.Text + "','" + TextBox19.Text + "',";
                query = query + "'" + LEmmst.Checked + "','" + TextBox23.Text + "','" + TextBox22.Text + "','" + TextBox41.Text + "','" + TextBox40.Text + "','" + TextBox27.Text + "','" + TextBox26.Text + "','" + TextBox43.Text + "','" + TextBox42.Text + "','" + TextBox29.Text + "','" + TextBox28.Text + "','" + TextBox45.Text + "','" + TextBox44.Text + "','" + TextBox47.Text + "','" + TextBox46.Text + "',";
                query = query + "'" + UEmmst.Checked + "','" + TextBox31.Text + "','" + TextBox30.Text + "','" + TextBox49.Text + "','" + TextBox48.Text + "','" + TextBox33.Text + "','" + TextBox32.Text + "','" + TextBox51.Text + "','" + TextBox50.Text + "','" + TextBox53.Text + "','" + TextBox52.Text + "','" + TextBox55.Text + "','" + TextBox54.Text + "','" + TextBox37.Text + "','" + TextBox36.Text + "','" + TextBox57.Text + "','" + TextBox56.Text + "','" + TextBox39.Text + "','" + TextBox38.Text + "','" + TextBox59.Text + "','" + TextBox58.Text + "')";
            }
            else
            {
                query = "update tblPatientIEDetailPage2 set ";

                query = query + "intactexcept='" + txtIntactExcept.Text + "',LEdtr = '" + LEdtr.Checked + "',DTRtricepsRight = '" + RTricepstxt.Text + "',DTRtricepsLeft ='" + LTricepstxt.Text + "',DTRBicepsRight ='" + RBicepstxt.Text + "',DTRBicepsLeft = '" + LBicepstxt.Text + "',DTRBrachioRight ='" + RBrachioradialis.Text + "',DTRBrachioLeft = '" + LBrachioradialis.Text + "' ,UEdtr = '" + UExchk.Checked + "',DTRKneeLeft = '" + LKnee.Text + "',DTRKneeRight = '" + RKnee.Text + "',DTRAnkleLeft = '" + LAnkle.Text + "' ,DTRAnkleRight  = '" + RAnkle.Text + "',Sensory = '" + txtSensory.Text.Replace("'", "''") + "',PinPrick = '" + chkPinPrick.Checked + "',Lighttouch = '" + chkLighttouch.Checked + "',";
                query = query + "LEsen = '" + LESen_Click.Checked + "',LEL3Right = '" + TextBox4.Text + "',LEL3Left = '" + txtDMTL3.Text + "',LEL4Right = '" + TextBox6.Text + "',LEL4Left = '" + TextBox5.Text + "',LEL5Right = '" + TextBox8.Text + "',LEL5Left = '" + TextBox7.Text + "',LES1Left = '" + TextBox10.Text + "',LES1Right = '" + TextBox21.Text + "',LELumberParaspinalsLeft = '" + TextBox24.Text + "',LELumberParaspinalsRight = '" + TextBox25.Text + "',UEsen ='" + UESen_Click.Checked + "',UEC5Left = '" + TextBox9.Text + "',UEC5Right = '" + txtUEC5Right.Text + "',UEC6Left = '" + TextBox11.Text + "',UEC6Right = '" + TextBox12.Text + "',UEC7Left = '" + TextBox13.Text + "',UEC7Right = '" + TextBox14.Text + "',UEC8Left = '" + TextBox15.Text + "',UEC8Right = '" + TextBox16.Text + "',UET1Right = '" + TextBox18.Text + "',UET1Left = '" + TextBox17.Text + "',UECervicalParaspinalsRight = '" + TextBox20.Text + "',UECervicalParaspinalsLeft = '" + TextBox19.Text + "',";
                query = query + "LEmmst = '" + LEmmst.Checked + "',LEHipFlexionRight = '" + TextBox23.Text + "',LEHipFlexionLeft = '" + TextBox22.Text + "',LEHipAbductionRight = '" + TextBox41.Text + "',LEHipAbductionLeft  = '" + TextBox40.Text + "',LEKneeExtensionRight = '" + TextBox27.Text + "',LEKneeExtensionLeft = '" + TextBox26.Text + "',LEKneeFlexionRight = '" + TextBox43.Text + "',LEKneeFlexionLeft = '" + TextBox42.Text + "',LEAnkleDorsiRight = '" + TextBox29.Text + "',LEAnkleDorsiLeft = '" + TextBox28.Text + "',LEAnklePlantarRight = '" + TextBox45.Text + "',LEAnklePlantarLeft = '" + TextBox44.Text + "',LEAnkleExtensorRight = '" + TextBox47.Text + "',LEAnkleExtensorLeft = '" + TextBox46.Text + "',";
                query = query + "UEmmst = '" + UEmmst.Checked + "',UEShoulderAbductionRight = '" + TextBox31.Text + "',UEShoulderAbductionLeft = '" + TextBox30.Text + "',UEShoulderFlexionRight = '" + TextBox49.Text + "',UEShoulderFlexionLeft = '" + TextBox48.Text + "',UEElbowExtensionRight = '" + TextBox33.Text + "',UEElbowExtensionLeft = '" + TextBox32.Text + "',UEElbowFlexionRight = '" + TextBox51.Text + "',UEElbowFlexionLeft = '" + TextBox50.Text + "',UEElbowSupinationRight = '" + TextBox53.Text + "',UEElbowSupinationLeft = '" + TextBox52.Text + "',UEElbowPronationRight = '" + TextBox55.Text + "',UEElbowPronationLeft = '" + TextBox54.Text + "',UEWristFlexionRight = '" + TextBox37.Text + "',UEWristFlexionLeft = '" + TextBox36.Text + "',UEWristExtensionRight = '" + TextBox57.Text + "',UEWristExtensionLeft = '" + TextBox56.Text + "',UEHandGripStrengthRight = '" + TextBox39.Text + "',UEHandGripStrengthLeft = '" + TextBox38.Text + "',UEHandFingerAbductorsRight = '" + TextBox59.Text + "',UEHandFingerAbductorsLeft = '" + TextBox58.Text + "'";
                query = query + " Where PatientIE_ID=" + Session["PatientIE_ID"].ToString() + "";
            }
            ds.Dispose();

            int val = db.executeQuery(query);

            query = "select top 1 * from tblPage3HTMLContent where PatientIE_ID=" + Session["PatientIE_ID"].ToString();
            ds    = db.selectData(query);
            if (ds.Tables[0].Rows.Count == 0)
            {
                query = "insert into tblPage3HTMLContent(PatientIE_ID,HTMLContent,topSectionHTML)values(@PatientIE_ID,@HTMLContent,@topSectionHTML)";
            }
            else
            {
                query = "update tblPage3HTMLContent set HTMLContent=@HTMLContent,topSectionHTML=@topSectionHTML where PatientIE_ID=@PatientIE_ID";
            }

            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString))
                using (SqlCommand command = new SqlCommand(query, connection))
                {
                    command.Parameters.AddWithValue("@PatientIE_ID", Session["PatientIE_ID"].ToString());
                    command.Parameters.AddWithValue("@HTMLContent", hdHTMLContent.Value);
                    command.Parameters.AddWithValue("@topSectionHTML", hdtopHTMLContent.Value);


                    connection.Open();
                    var results = command.ExecuteNonQuery();
                    connection.Close();
                }


            if (val > 0)
            {
                try
                {
                    long   _ieID     = Convert.ToInt64(Session["PatientIE_ID"].ToString());
                    string _ieMode   = "";
                    string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString;
                    string SqlStr    = "";
                    oSQLConn.ConnectionString = sProvider;
                    oSQLConn.Open();
                    SqlStr = "Select * from tblPatientIEDetailPage3 WHERE PatientIE_ID = " + _ieID;
                    SqlDataAdapter    sqlAdapt      = new SqlDataAdapter(SqlStr, oSQLConn);
                    SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt);
                    DataTable         sqlTbl        = new DataTable();
                    sqlAdapt.Fill(sqlTbl);
                    DataRow TblRow;

                    if (sqlTbl.Rows.Count == 0)
                    {
                        _ieMode = "New";
                    }
                    else if (sqlTbl.Rows.Count > 0)
                    {
                        _ieMode = "Update";
                    }

                    if (_ieMode == "New")
                    {
                        TblRow = sqlTbl.NewRow();
                    }
                    else if (_ieMode == "Update")
                    {
                        TblRow = sqlTbl.Rows[0];
                        TblRow.AcceptChanges();
                    }
                    else
                    {
                        TblRow = null;
                    }

                    if (_ieMode == "Update" || _ieMode == "New")
                    {
                        TblRow["PatientIE_ID"]       = _ieID;
                        TblRow["GAIT"]               = cboGAIT.Text.ToString();
                        TblRow["Ambulates"]          = cboAmbulates.Text.ToString();
                        TblRow["Footslap"]           = chkFootslap.Checked;
                        TblRow["Kneehyperextension"] = chkKneehyperextension.Checked;
                        TblRow["Unabletohealwalk"]   = chkUnabletohealwalk.Checked;
                        TblRow["Unabletotoewalk"]    = chkUnabletotoewalk.Checked;
                        TblRow["Other"]              = txtOther.Text.ToString();

                        if (_ieMode == "New")
                        {
                            TblRow["CreatedBy"]   = "Admin";
                            TblRow["CreatedDate"] = DateTime.Now;
                            sqlTbl.Rows.Add(TblRow);
                        }
                        sqlAdapt.Update(sqlTbl);
                    }
                    if (TblRow != null)
                    {
                        TblRow.Table.Dispose();
                    }
                    sqlTbl.Dispose();
                    sqlCmdBuilder.Dispose();
                    sqlAdapt.Dispose();
                    oSQLConn.Close();
                }
                catch (Exception ex)
                {
                    oSQLConn.Close();
                }
            }


            ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString(), "openPopup('mymodelmessage')", true);
            Logger.Info(Session["UserId"].ToString() + "--" + Session["uname"].ToString().Trim() + "-- Create IE - Page4 " + Session["PatientIE_ID"].ToString() + "--" + DateTime.Now);
            if (pageHDN.Value != null && pageHDN.Value != "")
            {
                Response.Redirect(pageHDN.Value.ToString());
            }
            else
            {
                Response.Redirect("Page5.aspx");
            }
        }
        catch (Exception ex)
        {
        }
    }
Пример #13
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            string query = "", locations = "", locations_id = "", page_id = "", pages = "", reports = "", roleid = "";


            for (int i = 0; i < chkLocations.Items.Count; i++)
            {
                if (chkLocations.Items[i].Selected)
                {
                    locations    = locations + "," + chkLocations.Items[i].Text;
                    locations_id = locations_id + "," + chkLocations.Items[i].Value;
                }
            }

            for (int i = 0; i < chkPages.Items.Count; i++)
            {
                if (chkPages.Items[i].Selected)
                {
                    pages   = pages + "," + chkPages.Items[i].Text;
                    page_id = page_id + "," + chkPages.Items[i].Value;
                }
            }

            for (int i = 0; i < chkReports.Items.Count; i++)
            {
                if (chkReports.Items[i].Selected)
                {
                    reports = reports + "," + chkReports.Items[i].Text;
                }
            }

            for (int i = 0; i < chkRole.Items.Count; i++)
            {
                if (chkRole.Items[i].Selected)
                {
                    roleid = roleid + "," + chkRole.Items[i].Value;
                }
            }

            if (Request["id"] != null)
            {
                query = "update tblGroups set Name='" + txtName.Text + "',";

                query = query + " page_id='" + page_id.TrimStart(',') + "',pages='" + pages.TrimStart(',') + "',";

                query = query + " locations_id='" + locations_id.TrimStart(',') + "',locations='" + locations.TrimStart(',') + "',reports='" + reports.TrimStart(',') + "',role_id='" + roleid.TrimStart(',') + "' where Id=" + Request["id"].ToString();
            }
            else
            {
                query = "insert into tblGroups(Name,locations_id,locations,page_id,pages,reports,role_id) values('" + txtName.Text + "',";
                query = query + " '" + locations_id.TrimStart(',') + "','" + locations.TrimStart(',') + "','" + page_id.TrimStart(',') + "','" + pages.TrimStart(',') + "','" + reports.TrimStart(',') + "','" + roleid.TrimStart(',') + "') ";
            }

            db.executeQuery(query);
            Response.Redirect("ViewGroups.aspx");
        }
        catch (Exception ex)
        {
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string query = "";

        if (ViewState["patientIEid"] == null)
        {
            query = "insert into dbo.tblPatientIEDetailPage1(";
            query = query + "PatientIE_ID,Sustained,Position,InvolvedIn,EMSTeam,WentTo,Via,HadXrayOf,HadCTScanOf,";
            query = query + "  PrescriptionFor,FreeForm,InjuryToHead,HadMRIOf)";
            query = query + "values(" + Session["PatientIE_ID"].ToString() + ",'" + ddl_accident_desc.Text + "','" + ddl_belt.Text + "','" + ddl_invovledin.Text + "',";
            query = query + "'" + ddl_EMS.Text + "','" + txt_hospital.Text + "','" + ddl_via.Text + "','" + txt_x_ray.Value + "',";
            query = query + "'" + txt_CT.Value + "','" + txt_prescription.Value + "','" + txt_which_what.Value + "','" + chk_headinjury.Checked + "','" + txt_mri.Value + "')";
        }
        else
        {
            query = "update  tblPatientIEDetailPage1 set ";
            query = query + "Sustained='" + ddl_accident_desc.Text + "',Position='" + ddl_belt.Text + "',";
            query = query + "InvolvedIn='" + ddl_invovledin.Text + "',EMSTeam='" + ddl_EMS.Text + "',WentTo='" + txt_hospital.Text + "',Via='" + ddl_via.Text + "',";
            query = query + "HadXrayOf='" + txt_x_ray.Value + "',HadCTScanOf='" + txt_CT.Value + "',";
            query = query + "  PrescriptionFor='" + txt_prescription.Value + "',FreeForm='" + txt_which_what.Value + "',InjuryToHead='" + chk_headinjury.Checked + "',";
            query = query + " HadMRIOf='" + txt_mri.Value + "' where PatientIE_ID=" + ViewState["patientIEid"].ToString();
        }
        int lresult = gDbhelperobj.executeQuery(query);

        if (lresult > 0)
        {
            if (ViewState["patientIEid"] == null)
            {
                query = "insert into tblInjuredBodyParts(PatientIE_ID,Neck,MidBack,LowBack,";
                query = query + "LeftShoulder,RightShoulder,LeftKnee,RightKnee,LeftElbow,RightElbow,";
                query = query + "LeftWrist,RightWrist,LeftAnkle,RightAnkle,Others)values";
                query = query + "(" + Session["PatientIE_ID"].ToString() + ",'" + chk_Neck.Checked + "','" + chk_Midback.Checked + "','" + chk_lowback.Checked + "',";
                query = query + "'" + chk_L_Shoulder.Checked + "','" + chk_r_Shoulder.Checked + "','" + chk_L_Keen.Checked + "','" + chk_r_Keen.Checked + "',";
                query = query + "'" + chk_l_Elbow.Checked + "','" + chk_r_Elbow.Checked + "','" + chk_l_Wrist.Checked + "','" + chk_r_Wrist.Checked + "',";
                query = query + "'" + chk_l_ankle.Checked + "','" + chk_r_ankle.Checked + "','" + txt_other.Value + "')";
            }
            else
            {
                query = "update tblInjuredBodyParts set Neck='" + chk_Neck.Checked + "',MidBack='" + chk_Midback.Checked + "',LowBack='" + chk_lowback.Checked + "',";
                query = query + "LeftShoulder='" + chk_L_Shoulder.Checked + "',RightShoulder='" + chk_r_Shoulder.Checked + "',LeftKnee='" + chk_L_Keen.Checked + "',RightKnee='" + chk_r_Keen.Checked + "',";
                query = query + "LeftElbow='" + chk_l_Elbow.Checked + "',RightElbow='" + chk_r_Elbow.Checked + "',";
                query = query + "LeftWrist='" + chk_l_Wrist.Checked + "',RightWrist='" + chk_r_Wrist.Checked + "',LeftAnkle='" + chk_l_ankle.Checked + "',";
                query = query + " RightAnkle='" + chk_r_ankle.Checked + "',Others='" + txt_other.Value + "' where PatientIE_ID=" + ViewState["patientIEid"].ToString();
            }
            lresult = gDbhelperobj.executeQuery(query);

            if (lresult > 0)
            {
                if (ViewState["patientIEid"] == null)
                {
                    lblMessage.InnerHtml = "Data Save successfuly.";
                }
                else
                {
                    lblMessage.InnerHtml = "Data Updated successfuly.";
                }
                lblMessage.Attributes.Add("style", "color:green");
                upMessage.Update();
            }
            else
            {
                lblMessage.InnerHtml = "Sorry,there may be same error.";
                lblMessage.Attributes.Add("style", "color:red");
            }
        }
        else
        {
            lblMessage.InnerHtml = "Sorry,there may be same error.";
            lblMessage.Attributes.Add("style", "color:red");
        }

        ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString(), "openPopup('mymodelmessage')", true);
    }