public static int Delete(int PaymentRangeID) { String sql = "SELECT ForeignEmploymentStatusID FROM tbl_foreign_employment_status " + "WHERE MadePaymentRangeID = " + PaymentRangeID + " OR AskedPayemntRageID = " + PaymentRangeID + " OR ReceiptPaymentRangeID = " + PaymentRangeID; DataView dv = new BaseDAO().ExecuteQuery(sql); if(dv.Count == 0) return new PaymentRangesDAO().Delete("PaymentRangeID=" + PaymentRangeID); return -1; }
public static List<EvidencesPerCase> GetAllByCaseID(int CaseID) { List<EvidencesPerCase> lstEvidencesPerCase = new List<EvidencesPerCase>(); DataView objDataView = new BaseDAO().Select("*", "tbl_evidences_per_case", "CaseID=" + CaseID); foreach (DataRowView drv in objDataView) { EvidencesPerCase objEvidencesPerCase = new EvidencesPerCase(); objEvidencesPerCase.EvidencesPerCaseID = (int)drv["EvidencesPerCaseID"]; objEvidencesPerCase.EvidenceTypeID = (int)drv["EvidenceTypeID"]; objEvidencesPerCase.CaseID = (int)drv["CaseID"]; lstEvidencesPerCase.Add(objEvidencesPerCase); } return lstEvidencesPerCase; }
public static DateTime GetCurrentDate() { DataView dv = new BaseDAO().GetServerDate(); return Convert.ToDateTime(dv.Table.Rows[0]["datetime"].ToString()); }
public static int GetOptionValue(String Value, String Key, String Field, String Table) { int val = 0; DataView dv = new BaseDAO().Select(Field + " AS VAL ", Table, Key + " = '" + Value + "'"); if (dv.Count > 0) return Convert.ToInt32(dv.Table.Rows[0]["VAL"]); return val; }