Ejemplo n.º 1
0
 protected void BtnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         int DeleteId = 0;
         if (ViewState["EditID"] != null)
         {
             DeleteId = Convert.ToInt32(ViewState["EditID"]);
         }
         if (DeleteId != 0)
         {
             Entity_PR.PriorityID = DeleteId;
             Entity_PR.LoginId    = Convert.ToInt32(Session["UserID"]);
             Entity_PR.LoginDate  = DateTime.Now;
             int iDelete = Obj_PR.DeleteRecord(ref Entity_PR, out StrError);
             if (iDelete != 0)
             {
                 obj_Comm.ShowPopUpMsg("Record Deleted Successfully..!", this.Page);
                 MakeEmptyForm();
             }
         }
         Entity_PR = null;
         obj_Comm  = null;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Ejemplo n.º 2
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0;

        try
        {
            if (ViewState["EditID"] != null)
            {
                Entity_PR.PriorityID = Convert.ToInt32(ViewState["EditID"]);
            }
            Entity_PR.Priority  = Priority.Text.Trim();
            Entity_PR.LoginId   = Convert.ToInt32(Session["UserId"]);
            Entity_PR.LoginDate = DateTime.Now;
            UpdateRow           = Obj_PR.UpdateRecord(ref Entity_PR, out StrError);
            if (UpdateRow != 0)
            {
                obj_Comm.ShowPopUpMsg("Record Updated Successfully", this.Page);
                MakeEmptyForm();
                Entity_PR = null;
                obj_Comm  = null;
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Ejemplo n.º 3
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        int InsertRow = 0;

        try
        {
            DS = Obj_PR.ChkDuplicate(Priority.Text.Trim(), out StrError);
            if (DS.Tables[0].Rows.Count > 0)
            {
                obj_Comm.ShowPopUpMsg("Priority Name Already Exist..!", this.Page);
                Priority.Focus();
            }
            else
            {
                Entity_PR.Priority  = Priority.Text.Trim();
                Entity_PR.LoginId   = Convert.ToInt32(Session["UserId"]);
                Entity_PR.LoginDate = DateTime.Now;
                InsertRow           = Obj_PR.InsertRecord(ref Entity_PR, out StrError);

                if (InsertRow != 0)
                {
                    obj_Comm.ShowPopUpMsg("Record Saved Successfully", this.Page);
                    MakeEmptyForm();
                    Entity_PR = null;
                    obj_Comm  = null;
                }
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Ejemplo n.º 4
0
        public int InsertRecord(ref PriorityMaster Entity_call, out string strError)
        {
            int iInsert = 0;

            strError = string.Empty;
            try
            {
                SqlParameter pAction      = new SqlParameter(PriorityMaster._Action, SqlDbType.BigInt);
                SqlParameter pPriority    = new SqlParameter(PriorityMaster._Priority, SqlDbType.NVarChar);
                SqlParameter pCreatedBy   = new SqlParameter(PriorityMaster._LoginId, SqlDbType.BigInt);
                SqlParameter PCreatedDate = new SqlParameter(PriorityMaster._LoginDate, SqlDbType.DateTime);

                pAction.Value      = 1;
                pPriority.Value    = Entity_call.Priority;
                pCreatedBy.Value   = Entity_call.LoginId;
                PCreatedDate.Value = Entity_call.LoginDate;

                SqlParameter[] param = new SqlParameter[] { pAction, pPriority, pCreatedBy, PCreatedDate };

                Open(CONNECTION_STRING);
                BeginTransaction();

                iInsert = SQLHelper.ExecuteNonQuery(_Connection, _Transaction, CommandType.StoredProcedure, PriorityMaster.SP_Priority, param);

                if (iInsert > 0)
                {
                    CommitTransaction();
                }
                else
                {
                    RollBackTransaction();
                }
            }

            catch (Exception ex)
            {
                RollBackTransaction();
                strError = ex.Message;
            }

            finally
            {
                Close();
            }
            return(iInsert);
        }
Ejemplo n.º 5
0
        public int DeleteRecord(ref PriorityMaster EntityCall, out string StrError)
        {
            int iDelete = 0;

            StrError = string.Empty;
            try
            {
                SqlParameter pAction      = new SqlParameter(PriorityMaster._Action, SqlDbType.BigInt);
                SqlParameter pPriorityId  = new SqlParameter(PriorityMaster._PriorityID, SqlDbType.BigInt);
                SqlParameter pDeletedBy   = new SqlParameter(PriorityMaster._LoginId, SqlDbType.BigInt);
                SqlParameter pDeletedDate = new SqlParameter(PriorityMaster._LoginDate, SqlDbType.DateTime);
                pAction.Value      = 3;
                pPriorityId.Value  = EntityCall.PriorityID;
                pDeletedBy.Value   = EntityCall.LoginId;
                pDeletedDate.Value = EntityCall.LoginDate;

                SqlParameter[] param = new SqlParameter[] { pAction, pPriorityId, pDeletedBy, pDeletedDate };

                Open(CONNECTION_STRING);
                BeginTransaction();

                iDelete = SQLHelper.ExecuteNonQuery(_Connection, _Transaction, CommandType.StoredProcedure, PriorityMaster.SP_Priority, param);

                if (iDelete > 0)
                {
                    CommitTransaction();
                }
                else
                {
                    RollBackTransaction();
                }
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                StrError = ex.Message;
            }
            finally
            {
                Close();
            }
            return(iDelete);
        }
Ejemplo n.º 6
0
 public void addPriority(PriorityMaster priority)
 {
     _context.PriorityMaster.Add(priority);
 }
Ejemplo n.º 7
0
 public void DeletePriority(PriorityMaster priorityMaster)
 {
     _context.PriorityMaster.Remove(priorityMaster);
 }