コード例 #1
0
ファイル: Index.aspx.cs プロジェクト: ayushman2013/SaMI.WebV2
        protected void btnSave_Click(object sender, EventArgs e)
        {
            EvidenceTypes objEvidenceTypes = new EvidenceTypes();
            objEvidenceTypes.EvidenceTypeDesc = txtEvidenceTypeDesc.Text;
            objEvidenceTypes.Status = 1;

            if (!string.IsNullOrEmpty(hfEvidenceTypeID.Value.ToString()))
            {
                objEvidenceTypes.UpdatedBy = UserAuthentication.GetUserId(this.Page);
                objEvidenceTypes.UpdatedDate = DateTime.Now;
                objEvidenceTypes.EvidenceTypeID = Convert.ToInt32(hfEvidenceTypeID.Value);
                objEvidenceTypes.EvidenceTypeDesc = txtEvidenceTypeDesc.Text;
                EvidenceTypeBO.UpdateEvidenceTypes(objEvidenceTypes);

            }
            else
            {
                objEvidenceTypes.CreatedBy = UserAuthentication.GetUserId(this.Page);
                objEvidenceTypes.CreatedDate = DateTime.Now;
                EvidenceTypeBO.InsertEvidenceTypes(objEvidenceTypes);
            }


            txtEvidenceTypeDesc.Text = string.Empty;
            hfEvidenceTypeID.Value = string.Empty;
            LoadCaseType();

        }
コード例 #2
0
        public int InsertEvidenceTypes(EvidenceTypes objCaseType)
        {
            objCaseType.EvidenceTypeID = 1;
            BeginTransaction();

            try
            {
                objCaseType.EvidenceTypeID = Insert(objCaseType);
                CommitTransaction();
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                objCaseType.EvidenceTypeID = -1;
            }

            return objCaseType.EvidenceTypeID;
        }
コード例 #3
0
ファイル: Index.aspx.cs プロジェクト: ayushman2013/SaMI.WebV2
        protected void gvEvidenceType_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            hfEvidenceTypeID.Value = e.CommandArgument.ToString();
            EvidenceTypes objEvidenceTypes = new EvidenceTypes();

            if (e.CommandName.Equals("cmdEdit"))
            {
                objEvidenceTypes = EvidenceTypeBO.GetEvidenceTypes(Convert.ToInt32(e.CommandArgument));
                txtEvidenceTypeDesc.Text = objEvidenceTypes.EvidenceTypeDesc;
            }
            else if (e.CommandName.Equals("cmdDelete"))
            {
                int EvidenceTypeID = Convert.ToInt32(e.CommandArgument);
                objEvidenceTypes.EvidenceTypeID = EvidenceTypeID;
                objEvidenceTypes.Status = 0;
                EvidenceTypeBO.DeleteEvidenceTypes(objEvidenceTypes);
                LoadCaseType();
            }
        }
コード例 #4
0
        public int DeleteEvidenceTypes(EvidenceTypes objEvidenceTypes)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "Status" };
                rowsaffected = Update(objEvidenceTypes, UpdateProperties);

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;

        }
コード例 #5
0
 public static int DeleteEvidenceTypes(EvidenceTypes objEvidenceTypes)
 {
     return new EvidenceTypeDAO().DeleteEvidenceTypes(objEvidenceTypes);
 }
コード例 #6
0
 public static int UpdateEvidenceTypes(EvidenceTypes objEvidenceTypes)
 {
     return new EvidenceTypeDAO().UpdateEvidenceTypes(objEvidenceTypes);
 }
コード例 #7
0
 public static EvidenceTypes GetEvidenceTypes(int EvidenceTypeID)
 {
     EvidenceTypes objCaseType = new EvidenceTypes();
     return (EvidenceTypes)(new EvidenceTypeDAO().FillDTO(objCaseType, "EvidenceTypeID=" + EvidenceTypeID));
 }
コード例 #8
0
 public static int InsertEvidenceTypes(EvidenceTypes objCaseType)
 {
     return new EvidenceTypeDAO().InsertEvidenceTypes(objCaseType);
 }