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(); }
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; }
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(); } }
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; }
public static int DeleteEvidenceTypes(EvidenceTypes objEvidenceTypes) { return new EvidenceTypeDAO().DeleteEvidenceTypes(objEvidenceTypes); }
public static int UpdateEvidenceTypes(EvidenceTypes objEvidenceTypes) { return new EvidenceTypeDAO().UpdateEvidenceTypes(objEvidenceTypes); }
public static EvidenceTypes GetEvidenceTypes(int EvidenceTypeID) { EvidenceTypes objCaseType = new EvidenceTypes(); return (EvidenceTypes)(new EvidenceTypeDAO().FillDTO(objCaseType, "EvidenceTypeID=" + EvidenceTypeID)); }
public static int InsertEvidenceTypes(EvidenceTypes objCaseType) { return new EvidenceTypeDAO().InsertEvidenceTypes(objCaseType); }