public int InsertUpdateProcedureNotes(ProcedureNotes_Entity objPN)
        {
            try
            {
                int ReturnID;
                int OutputProcNotes_ID = 0;
                errmsg = string.Empty;
                System.Data.SqlClient.SqlParameter[] p = new SqlParameter[11];

                p[0]               = new SqlParameter("@ProcNotes_ID", objPN.ProcNotes_ID);
                p[1]               = new SqlParameter("@Proc_ID", objPN.Proc_ID);
                p[2]               = new SqlParameter("@ParentID", objPN.ParentID);
                p[3]               = new SqlParameter("@SerialNumber", objPN.SerialNumber);
                p[4]               = new SqlParameter("@Notes", objPN.Notes);
                p[5]               = new SqlParameter("@CreatedBy", objPN.CreatedBy);
                p[6]               = new SqlParameter("@LastUpdatedBy", objPN.LastUpdatedBy);
                p[7]               = new SqlParameter("@SequenceNumber", objPN.SequenceNumber);
                p[8]               = new SqlParameter("@SNO", objPN.SNO);
                p[9]               = new SqlParameter("@SeqNum", objPN.SeqNum);
                p[10]              = new SqlParameter("@OutputProcNotes_ID", OutputProcNotes_ID);
                p[10].Direction    = ParameterDirection.Output;
                ReturnID           = objDB.ExecuteProc("QAACHE.INS_UPD_ProcNotes", p, ref errmsg);
                OutputProcNotes_ID = Convert.ToInt32(p[10].Value);
                return(OutputProcNotes_ID);
            }
            catch (Exception ex)
            {
                throw new Exception("Error in Creating / Updating Procedure Notes _ DAL " + ex.Message);
            }
        }
Example #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();
                }
            }
        }
Example #3
0
        public int InsertUpdateProcedureNotes(ProcedureNotes_Entity objPN)
        {
            clsProcedureNotes_DAL objALDAL = new clsProcedureNotes_DAL();

            return(objALDAL.InsertUpdateProcedureNotes(objPN));
        }
Example #4
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();
                }
            }
        }