public int InsertUpdateProcedureNotesLines(ProcNotes_Lines_Entity objPNL)
        {
            try
            {
                int ReturnID;
                int OutputProcNotes_Line_ID = 0;
                errmsg = string.Empty;
                System.Data.SqlClient.SqlParameter[] p = new SqlParameter[10];

                p[0]                    = new SqlParameter("@ProcNotes_Line_ID", objPNL.ProcNotes_Line_ID);
                p[1]                    = new SqlParameter("@ProcNotes_ID", objPNL.ProcNotes_ID);
                p[2]                    = new SqlParameter("@LineNumber", objPNL.LineNumber);
                p[3]                    = new SqlParameter("@Notes_Type", objPNL.Notes_Type);
                p[4]                    = new SqlParameter("@Notes", objPNL.Notes);
                p[5]                    = new SqlParameter("@Notes_Binary", objPNL.Notes_Binary);
                p[6]                    = new SqlParameter("@IsActive", objPNL.IsActive);
                p[7]                    = new SqlParameter("@CreatedBy", objPNL.CreatedBy);
                p[8]                    = new SqlParameter("@LastUpdatedBy", objPNL.LastUpdatedBy);
                p[9]                    = new SqlParameter("@OutputProcNotes_Line_ID", OutputProcNotes_Line_ID);
                p[9].Direction          = ParameterDirection.Output;
                ReturnID                = objDB.ExecuteProc("QAACHE.INS_UPD_ProcNotes_Lines", p, ref errmsg);
                OutputProcNotes_Line_ID = Convert.ToInt32(p[9].Value);
                return(OutputProcNotes_Line_ID);
            }
            catch (Exception ex)
            {
                throw new Exception("Error in Creating / Updating Procedure Notes Lines _ DAL " + ex.Message);
            }
        }
Esempio n. 2
0
        protected void lnkbtnUpdateNotes_Click(object sender, EventArgs e)
        {
            objProcedureNotes_Bal        = new clsProcedureNotes_BAL();
            objProcedureNotesEntity      = new ProcedureNotes_Entity();
            objProcedureNotesLinesEntity = new ProcNotes_Lines_Entity();

            if (lblProcNotes_Line_ID.Text.ToString() != "")
            {
                objProcedureNotesLinesEntity.ProcNotes_Line_ID = Convert.ToInt32(lblProcNotes_Line_ID.Text.ToString());
                objProcedureNotesLinesEntity.ProcNotes_ID      = Convert.ToInt32(lblProcNotes_ID.Text.ToString());
                objProcedureNotesLinesEntity.LineNumber        = Convert.ToInt32(lblLineNumber.Text);
                objProcedureNotesLinesEntity.Notes_Type        = rbtnlstNotesType.SelectedItem.Text.ToString();
                objProcedureNotesLinesEntity.Notes             = CKEditorControl1.Text.ToString();
                objProcedureNotesLinesEntity.Notes_Binary      = new byte[0];

                if (rbtnlstActiveInActive.SelectedItem.Text == "Active")
                {
                    objProcedureNotesLinesEntity.IsActive = true;
                }
                else if (rbtnlstActiveInActive.SelectedItem.Text == "InActive")
                {
                    objProcedureNotesLinesEntity.IsActive = false;
                }

                objProcedureNotesLinesEntity.CreatedBy     = Convert.ToInt32(Session["UserID"]);;
                objProcedureNotesLinesEntity.LastUpdatedBy = Convert.ToInt32(Session["UserID"]);;

                ProcNotes_Line_ID = objProcedureNotes_Bal.InsertUpdateProcedureNotesLines(objProcedureNotesLinesEntity);

                if (objProcedureNotesLinesEntity.LineNumber == 1 && objProcedureNotesLinesEntity.Notes_Type.ToString() == "Text")
                {
                    objProcedureNotesEntity.ProcNotes_ID  = objProcedureNotesLinesEntity.ProcNotes_ID;
                    objProcedureNotesEntity.Notes         = objProcedureNotesLinesEntity.Notes;
                    objProcedureNotesEntity.LastUpdatedBy = Convert.ToInt32(Session["UserID"]);;
                    objProcedureNotesEntity.SerialNumber  = "";

                    ProcNotes_ID = objProcedureNotes_Bal.InsertUpdateProcedureNotes(objProcedureNotesEntity);
                }

                if (ProcNotes_Line_ID > 0)
                {
                    CKEditorControl1.Text = "";
                    rbtnlstNotesType.Text = "Text";
                    rbtnlstNotesType.Items.FindByText("Text").Selected = true;
                    rbtnlstActiveInActive.Text = "Active";
                    rbtnlstActiveInActive.Items.FindByText("Active").Selected = true;

                    GetProcNoteLine(Convert.ToInt32(lblProcNotes_ID.Text.ToString()));
                    GetProcNotesByProcID();
                }
            }
        }
Esempio n. 3
0
        public int InsertUpdateProcedureNotesLines(ProcNotes_Lines_Entity objPNL)
        {
            clsProcedureNotes_DAL objALDAL = new clsProcedureNotes_DAL();

            return(objALDAL.InsertUpdateProcedureNotesLines(objPNL));
        }
Esempio n. 4
0
        protected void lnkbtnAddLine_Click(object sender, EventArgs e)
        {
            objProcedureNotes_Bal        = new clsProcedureNotes_BAL();
            objProcedureNotesLinesEntity = new ProcNotes_Lines_Entity();

            if (Convert.ToInt32(hfProcNotes_ID.Value.ToString()) > 0)
            {
                if (rbtnlstNotesType.SelectedItem.Text.ToString() == "Text")
                {
                    if (CKEditorControl1.Text == "")
                    {
                        ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage2", "Showalert_Notes();", true);
                        return;
                    }
                }

                int _LineNumber = 0;

                ProcNotes_Line_ID            = 0;
                objProcedureNotesLinesEntity = new ProcNotes_Lines_Entity();
                objProcedureNotesLinesEntity.ProcNotes_Line_ID = ProcNotes_Line_ID;

                if (Convert.ToInt32(hfParentID.Value.ToString()) == 0)
                {
                    objProcedureNotesLinesEntity.ProcNotes_ID = ProcNotes_ID;
                }
                else
                {
                    objProcedureNotesLinesEntity.ProcNotes_ID = Convert.ToInt32(hfProcNotes_ID.Value.ToString());
                }

                _LineNumber = objProcedureNotes_Bal.GetMaxLineNumber(Convert.ToInt32(hfProcNotes_ID.Value.ToString()));

                objProcedureNotesLinesEntity.LineNumber = _LineNumber + 1;

                objProcedureNotesLinesEntity.Notes_Type = rbtnlstNotesType.SelectedItem.Text.ToString();

                string _htmltext = "";
                _htmltext = CKEditorControl1.Text.ToString();

                objProcedureNotesLinesEntity.Notes = _htmltext;
                //objProcedureNotesLinesEntity.Notes = Addnewline(_htmltext);

                //objProcedureNotesLinesEntity.Notes = Addnewline(_htmltext,125);

                objProcedureNotesLinesEntity.Notes_Binary = new byte[0];

                if (rbtnlstActiveInActive.SelectedItem.Text == "Active")
                {
                    objProcedureNotesLinesEntity.IsActive = true;
                }
                else if (rbtnlstActiveInActive.SelectedItem.Text == "InActive")
                {
                    objProcedureNotesLinesEntity.IsActive = false;
                }

                objProcedureNotesLinesEntity.CreatedBy     = Convert.ToInt32(Session["UserID"]);;
                objProcedureNotesLinesEntity.LastUpdatedBy = Convert.ToInt32(Session["UserID"]);;

                ProcNotes_Line_ID = objProcedureNotes_Bal.InsertUpdateProcedureNotesLines(objProcedureNotesLinesEntity);

                hfProcNotes_Line_ID.Value = ProcNotes_Line_ID.ToString();

                if (ProcNotes_Line_ID > 0)
                {
                    CKEditorControl1.Text = "";
                    rbtnlstNotesType.Text = "Text";
                    rbtnlstNotesType.Items.FindByText("Text").Selected = true;
                    rbtnlstActiveInActive.Text = "Active";
                    rbtnlstActiveInActive.Items.FindByText("Active").Selected = true;

                    GetProcNoteLine(Convert.ToInt32(hfProcNotes_ID.Value.ToString()));
                }
            }
        }
Esempio n. 5
0
        protected void lnkbtnAddNode_Click(object sender, EventArgs e)
        {
            objProcedureNotes_Bal = new clsProcedureNotes_BAL();
            int _ProcID          = 0;
            int _CountOfProcID   = 0;
            int _SequenceNumber  = 0;
            int _SNO             = 0;
            int _ChildNotesCount = 0;
            int _SeqNum          = 0;
            int _ParentID        = 0;

            if (ddlProcedureList.SelectedItem.Value == "-1")
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage1", "Showalert_ProcedureList();", true);
                return;
            }
            else
            {
                objProcedureNotesEntity = new ProcedureNotes_Entity();

                _ProcID        = Convert.ToInt32(ddlProcedureList.SelectedItem.Value.ToString());
                _CountOfProcID = objProcedureNotes_Bal.GetCountOfProc_ID(_ProcID);

                if (_CountOfProcID > 0)
                {
                    if (Convert.ToInt32(hfParentID.Value.ToString()) == 0)
                    {
                        _ParentID = Convert.ToInt32(hfParentID.Value.ToString());
                        objProcedureNotesEntity.SequenceNumber = 1;
                        objProcedureNotesEntity.SeqNum         = 1;
                        _SNO = objProcedureNotes_Bal.GetCountOfChildNodes(Convert.ToInt32(hfProcNotes_ID.Value.ToString()));
                        objProcedureNotesEntity.SNO          = _SNO + 1;
                        objProcedureNotesEntity.SerialNumber = objProcedureNotesEntity.SNO.ToString();
                        objProcedureNotesEntity.Notes        = (objProcedureNotesEntity.SNO) + " - Blank";
                    }
                    else
                    {
                        _ParentID       = Convert.ToInt32(hfParentID.Value.ToString());
                        _SequenceNumber = objProcedureNotes_Bal.GetMaxSequenceNumber(Convert.ToInt32(hfProcNotes_ID.Value.ToString()));
                        _SeqNum         = objProcedureNotes_Bal.GetMaxSeqNum(Convert.ToInt32(hfProcNotes_ID.Value.ToString()));

                        _ChildNotesCount = objProcedureNotes_Bal.GetCountOfChildNodes(Convert.ToInt32(hfProcNotes_ID.Value.ToString()));
                        if (_ChildNotesCount > 0)
                        {
                            objProcedureNotesEntity.SeqNum       = _SeqNum + 1;
                            objProcedureNotesEntity.SerialNumber = hfSerialNumber.Value.ToString() + "." + objProcedureNotesEntity.SeqNum.ToString();
                        }
                        else
                        {
                            objProcedureNotesEntity.SeqNum       = 1;
                            objProcedureNotesEntity.SerialNumber = hfSerialNumber.Value.ToString() + "." + objProcedureNotesEntity.SeqNum.ToString();
                        }

                        objProcedureNotesEntity.SNO            = 0;
                        objProcedureNotesEntity.SequenceNumber = _SequenceNumber + 1;

                        objProcedureNotesEntity.Notes = objProcedureNotesEntity.SerialNumber.ToString() + " - Blank";
                    }

                    ProcNotes_ID = 0;
                    objProcedureNotesEntity.ProcNotes_ID = ProcNotes_ID;
                    objProcedureNotesEntity.Proc_ID      = _ProcID;
                    objProcedureNotesEntity.ParentID     = Convert.ToInt32(hfProcNotes_ID.Value.ToString());
                    lblParentID.Text = objProcedureNotesEntity.ParentID.ToString();
                    objProcedureNotesEntity.CreatedBy     = Convert.ToInt32(Session["UserID"]);
                    objProcedureNotesEntity.LastUpdatedBy = Convert.ToInt32(Session["UserID"]);;
                }
                else
                {
                    ProcNotes_ID            = 0;
                    objProcedureNotesEntity = new ProcedureNotes_Entity();
                    objProcedureNotesEntity.ProcNotes_ID   = ProcNotes_ID;
                    objProcedureNotesEntity.Proc_ID        = _ProcID;
                    objProcedureNotesEntity.ParentID       = 0;
                    objProcedureNotesEntity.SerialNumber   = "0";
                    objProcedureNotesEntity.Notes          = ddlProcedureList.SelectedItem.Text.ToString();
                    objProcedureNotesEntity.CreatedBy      = Convert.ToInt32(Session["UserID"]);;
                    objProcedureNotesEntity.LastUpdatedBy  = Convert.ToInt32(Session["UserID"]);;
                    objProcedureNotesEntity.SequenceNumber = 0;
                    objProcedureNotesEntity.SNO            = 0;
                    objProcedureNotesEntity.SeqNum         = 0;
                    _ParentID = 0;
                }

                ProcNotes_ID = objProcedureNotes_Bal.InsertUpdateProcedureNotes(objProcedureNotesEntity);

                if (ProcNotes_ID > 0)
                {
                    if (objProcedureNotesEntity.ParentID > 0)
                    {
                        int _LineNumber = 0;

                        ProcNotes_Line_ID            = 0;
                        objProcedureNotesLinesEntity = new ProcNotes_Lines_Entity();
                        objProcedureNotesLinesEntity.ProcNotes_Line_ID = ProcNotes_Line_ID;

                        objProcedureNotesLinesEntity.ProcNotes_ID = ProcNotes_ID;

                        _LineNumber = objProcedureNotes_Bal.GetMaxLineNumber(ProcNotes_ID);

                        objProcedureNotesLinesEntity.LineNumber = _LineNumber + 1;

                        objProcedureNotesLinesEntity.Notes_Type = "Text";
                        objProcedureNotesLinesEntity.Notes      = objProcedureNotesEntity.Notes.ToString();

                        objProcedureNotesLinesEntity.Notes_Binary = new byte[0];
                        objProcedureNotesLinesEntity.IsActive     = true;
                        objProcedureNotesEntity.CreatedBy         = Convert.ToInt32(Session["UserID"]);;
                        objProcedureNotesEntity.LastUpdatedBy     = Convert.ToInt32(Session["UserID"]);

                        ProcNotes_Line_ID = objProcedureNotes_Bal.InsertUpdateProcedureNotesLines(objProcedureNotesLinesEntity);

                        hfProcNotes_Line_ID.Value = ProcNotes_Line_ID.ToString();
                    }
                    else
                    {
                    }
                }

                if (ProcNotes_ID > 0)
                {
                    GetProcNotesByProcID();
                }
            }
        }