public static CRMScroll GetLastCRMScrollByOfficeID() { DataRow TheCRMScrollDataRow = CRMScrollDataAccess.GetInstance.GetLastCRMScrollByOfficeID(); CRMScroll TheCRMScroll = DataRowToObject(TheCRMScrollDataRow); return(TheCRMScroll); }
public static CRMScroll GetCRMScrollByID(int scrollID) { DataRow TheCRMScrollDataRow = CRMScrollDataAccess.GetInstance.GetCRMScrollByID(scrollID); CRMScroll TheCRMScroll = DataRowToObject(TheCRMScrollDataRow); return(TheCRMScroll); }
public static List <CRMScroll> GetCRMScrollListByDate(DateTime scrollDate) { List <CRMScroll> ScrollList = new List <CRMScroll>(); DataTable ScrollTable = CRMScrollDataAccess.GetInstance.GetCRMScrollListByDate(scrollDate); foreach (DataRow dr in ScrollTable.Rows) { CRMScroll TheCRMScroll = DataRowToObject(dr); ScrollList.Add(TheCRMScroll); } return(ScrollList); }
private static CRMScroll DataRowToObject(DataRow dr) { CRMScroll TheCRMScroll = new CRMScroll { ScrollID = int.Parse(dr["ScrollID"].ToString()), ScrollNumber = int.Parse(dr["ScrollNumber"].ToString()), ScrollDate = DateTime.Parse(dr["ScrollDate"].ToString()).ToString(MicroConstants.DateFormat), DepositorName = dr["DepositorName"].ToString(), ScrollAmountPayable = decimal.Parse(dr["ScrollAmountPayable"].ToString()), ScrollAmountPaid = decimal.Parse(dr["ScrollAmountPaid"].ToString()), ScrollStatus = dr["ScrollStatus"].ToString(), OfficeID = int.Parse(dr["OfficeID"].ToString()), OfficeName = dr["OfficeName"].ToString() }; return(TheCRMScroll); }
public int DeleteCRMScroll(CRMScroll theCRMScroll) { int ReturnValue = 0; using (SqlCommand DeleteCommand = new SqlCommand()) { DeleteCommand.CommandType = CommandType.StoredProcedure; DeleteCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output; DeleteCommand.Parameters.Add(GetParameter("@ScrollID", SqlDbType.Int, theCRMScroll.ScrollID)); DeleteCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID)); DeleteCommand.CommandText = "pCRM_Scrolls_Delete"; ExecuteStoredProcedure(DeleteCommand); ReturnValue = int.Parse(DeleteCommand.Parameters[0].Value.ToString()); return(ReturnValue); } }
public int UpdateCRMScroll(CRMScroll theCRMScroll) { int ReturnValue = 0; using (SqlCommand UpdateCommand = new SqlCommand()) { UpdateCommand.CommandType = CommandType.StoredProcedure; UpdateCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output; UpdateCommand.Parameters.Add(GetParameter("@ScrollID", SqlDbType.Int, theCRMScroll.ScrollID)); UpdateCommand.Parameters.Add(GetParameter("@DepositorName", SqlDbType.VarChar, theCRMScroll.DepositorName)); UpdateCommand.Parameters.Add(GetParameter("@ScrollAmountPayable", SqlDbType.Decimal, theCRMScroll.ScrollAmountPayable)); UpdateCommand.Parameters.Add(GetParameter("@ScrollAmountPaid", SqlDbType.Decimal, theCRMScroll.ScrollAmountPaid)); UpdateCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID)); UpdateCommand.CommandText = "pCRM_Scrolls_Update"; ExecuteStoredProcedure(UpdateCommand); ReturnValue = int.Parse(UpdateCommand.Parameters[0].Value.ToString()); return(ReturnValue); } }
public int InsertCRMScroll(CRMScroll theCRMScroll) { int ReturnValue = 0; using (SqlCommand InsertCommand = new SqlCommand()) { InsertCommand.CommandType = CommandType.StoredProcedure; InsertCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output; InsertCommand.Parameters.Add(GetParameter("@ScrollDate", SqlDbType.VarChar, theCRMScroll.ScrollDate)); InsertCommand.Parameters.Add(GetParameter("@DepositorName", SqlDbType.VarChar, theCRMScroll.DepositorName)); InsertCommand.Parameters.Add(GetParameter("@ScrollAmountPayable", SqlDbType.Decimal, theCRMScroll.ScrollAmountPayable)); InsertCommand.Parameters.Add(GetParameter("@ScrollAmountPaid", SqlDbType.Decimal, theCRMScroll.ScrollAmountPaid)); InsertCommand.Parameters.Add(GetParameter("@ScrollStatus", SqlDbType.VarChar, theCRMScroll.ScrollStatus)); InsertCommand.Parameters.Add(GetParameter("@OfficeID", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.OfficeID)); InsertCommand.Parameters.Add(GetParameter("@AddedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID)); InsertCommand.CommandText = "pCRM_Scrolls_Insert"; ExecuteStoredProcedure(InsertCommand); ReturnValue = int.Parse(InsertCommand.Parameters[0].Value.ToString()); return(ReturnValue); } }
public int DeleteCRMScroll(CRMScroll theCRMScroll) { return(CRMScrollIntegration.DeleteCRMScroll(theCRMScroll)); }
public int UpdateCRMScroll(CRMScroll theCRMScroll) { return(CRMScrollIntegration.UpdateCRMScroll(theCRMScroll)); }
public int InsertCRMScroll(CRMScroll theCRMScroll) { return(CRMScrollIntegration.InsertCRMScroll(theCRMScroll)); }
public static int DeleteCRMScroll(CRMScroll theCRMScroll) { return(CRMScrollDataAccess.GetInstance.DeleteCRMScroll(theCRMScroll)); }
public static int InsertCRMScroll(CRMScroll theCRMScroll) { return(CRMScrollDataAccess.GetInstance.InsertCRMScroll(theCRMScroll)); }