public string DeleteProcessMaster(DTO.ProcessMaster Obj) { string res = string.Empty; int TotalItems = 0; try { TotalItems = CountTotalBooking(Obj); if (TotalItems > 0) { res = "Selected service is in use hence can't be deleted."; return(res); } else { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_sp_ProcessMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ProcessCode", Obj.ProcessCode); cmd.Parameters.AddWithValue("@BranchId", Obj.BID); cmd.Parameters.AddWithValue("@Flag", 3); res = PrjClass.ExecuteNonQuery(cmd); } } catch (Exception) { res = ""; } return(res); }
public string UpdateProcessMaster(DTO.ProcessMaster Obj) { string res = ""; try { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_sp_ProcessMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ProcessCode", Obj.ProcessCode); cmd.Parameters.AddWithValue("@ProcessName", Obj.ProcessName); cmd.Parameters.AddWithValue("@ProcessUsedForVendorReport", Obj.UsedForvendorReport); cmd.Parameters.AddWithValue("@Discount", Obj.Discount); cmd.Parameters.AddWithValue("@ServiceTax", Obj.ServiceTax); cmd.Parameters.AddWithValue("@IsActiveServiceTax", Obj.IsActiveServiceTax); cmd.Parameters.AddWithValue("@IsDiscount", Obj.IsDiscount); cmd.Parameters.AddWithValue("@IsChallan", Obj.IsChallanApplicable); cmd.Parameters.AddWithValue("@ImagePath", Obj.ImagePath); cmd.Parameters.AddWithValue("@CssTax", Obj.CssTax); cmd.Parameters.AddWithValue("@EcesjTax", Obj.EcesjTax); cmd.Parameters.AddWithValue("@IsChallanByPass", Obj.IsReady); cmd.Parameters.AddWithValue("@BranchId", Obj.BID); cmd.Parameters.AddWithValue("@Flag", 2); res = PrjClass.ExecuteNonQuery(cmd); } catch (Exception) { res = ""; } return(res); }
public bool CheckDuplicateProcess(DTO.ProcessMaster Obj) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; bool status = false; try { cmd.CommandText = "sp_sp_ProcessMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ProcessCode", Obj.ProcessCode); cmd.Parameters.AddWithValue("@BranchId", Obj.BID); cmd.Parameters.AddWithValue("@Flag", 7); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { status = true; } else { status = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(status); }
private int CountTotalBooking(DTO.ProcessMaster Obj) { SqlDataReader sdr = null; SqlCommand cmd = new SqlCommand(); int TotalItems = 0; try { cmd.CommandText = "sp_sp_ProcessMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ProcessCode", Obj.ProcessCode); cmd.Parameters.AddWithValue("@BranchId", Obj.BID); cmd.Parameters.AddWithValue("@Flag", 6); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { TotalItems = int.Parse("0" + sdr.GetValue(0)); } else { TotalItems = 0; } } catch (Exception) { TotalItems = 0; } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(TotalItems); }
public DataSet SearchProcessMaster(DTO.ProcessMaster Obj) { DataSet ds = new DataSet(); try { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_sp_ProcessMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ProcessName", Obj.ProcessName); cmd.Parameters.AddWithValue("@BranchId", Obj.BID); cmd.Parameters.AddWithValue("@Flag", 5); ds = PrjClass.GetData(cmd); } catch (Exception) { } return(ds); }
public string SaveProcessMaster(DTO.ProcessMaster Obj) { return(DAL.DALFactory.Instance.Dal_ProcessMaster.SaveProcessMaster(Obj)); }
public DataSet SearchProcessMaster(DTO.ProcessMaster Obj) { return(DAL.DALFactory.Instance.Dal_ProcessMaster.SearchProcessMaster(Obj)); }