Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 public string SaveProcessMaster(DTO.ProcessMaster Obj)
 {
     return(DAL.DALFactory.Instance.Dal_ProcessMaster.SaveProcessMaster(Obj));
 }
Esempio n. 7
0
 public DataSet SearchProcessMaster(DTO.ProcessMaster Obj)
 {
     return(DAL.DALFactory.Instance.Dal_ProcessMaster.SearchProcessMaster(Obj));
 }