public frmRegisterStatus()
 {
     InitializeComponent();
     m_oStatus    = new Vendor.BusinessLayer.StatusBL();
     m_oRegister  = new Vendor.BusinessLayer.RegisterBL();
     m_oRegUpdate = new Vendor.BusinessLayer.RegUpdateBL();
 }
Exemple #2
0
 public frmRegTrans()
 {
     InitializeComponent();
     m_oRegister  = new Vendor.BusinessLayer.RegisterBL();
     m_oRegUpdate = new Vendor.BusinessLayer.RegUpdateBL();
     oVType       = new BsfGlobal.VoucherType();
 }
Exemple #3
0
        public void UpdateGradeTrans(Vendor.BusinessLayer.RegisterBL argRegister)
        {
            SqlConnection conn;

            conn = new SqlConnection();
            conn = BsfGlobal.OpenVendorAnalDB();
            SqlTransaction tran = conn.BeginTransaction();

            try
            {
                SqlCommand Command = new SqlCommand("Update_GradeTrans", conn, tran);
                Command.CommandType = CommandType.StoredProcedure;
                Command.Parameters.Clear();
                Command.Parameters.AddWithValue("@VendorId", argRegister.VendorId);
                Command.Parameters.AddWithValue("@SGradeId", argRegister.SGradeId);
                Command.Parameters.AddWithValue("@CGradeId", argRegister.CGradeId);
                Command.Parameters.AddWithValue("@HGradeId", argRegister.HGradeId);
                Command.ExecuteNonQuery();
                tran.Commit();
            }
            catch
            {
                tran.Rollback();
            }
            finally
            {
                conn.Close();
            }
        }
Exemple #4
0
        public void InsertAssessment(Vendor.BusinessLayer.RegisterBL argRegister)
        {
            SqlConnection conn;

            conn = new SqlConnection();
            conn = BsfGlobal.OpenVendorAnalDB();
            SqlTransaction tran = conn.BeginTransaction();

            try
            {
                SqlCommand Command = new SqlCommand("Insert_VendorAssesment", conn, tran);
                Command.CommandType = CommandType.StoredProcedure;
                Command.Parameters.Clear();
                Command.Parameters.AddWithValue("@VendorId", argRegister.VendorId);
                Command.Parameters.AddWithValue("@SupplyMaxPoint", argRegister.SupplyMaxPoint);
                Command.Parameters.AddWithValue("@SupplyPoints", argRegister.SupplyPoints);
                Command.Parameters.AddWithValue("@ContractMaxPoint", argRegister.ContractMaxPoint);
                Command.Parameters.AddWithValue("@ContractPoints", argRegister.ContractPoints);
                Command.Parameters.AddWithValue("@ServiceMaxPoint", argRegister.ServiceMaxPoint);
                Command.Parameters.AddWithValue("@ServicePoints", argRegister.ServicePoints);
                Command.ExecuteNonQuery();
                tran.Commit();
            }
            catch
            {
                tran.Rollback();
            }
            finally
            {
                conn.Close();
            }
        }
Exemple #5
0
        public void InsertRegTrans(Vendor.BusinessLayer.RegisterBL argRegister, int argTypeId)
        {
            SqlConnection conn;

            conn = new SqlConnection();
            conn = BsfGlobal.OpenVendorAnalDB();
            SqlTransaction tran = conn.BeginTransaction();

            try
            {
                SqlCommand Command = new SqlCommand("Insert_RegTrans", conn, tran);
                Command.CommandType = CommandType.StoredProcedure;
                Command.Parameters.Clear();
                Command.Parameters.AddWithValue("@VendorId", argRegister.VendorId);
                Command.Parameters.AddWithValue("@RegId", argRegister.RegisterId);
                Command.Parameters.AddWithValue("@RDate", argRegister.RegDate);
                Command.Parameters.AddWithValue("@RefNo ", argRegister.RegNo);
                Command.Parameters.AddWithValue("@StatusType ", argRegister.StatusType);
                Command.Parameters.AddWithValue("@Supply", argRegister.Supply);
                Command.Parameters.AddWithValue("@Contract", argRegister.Contract);
                Command.Parameters.AddWithValue("@Service", argRegister.Service);
                Command.Parameters.AddWithValue("@SGradeId", argRegister.SGradeId);
                Command.Parameters.AddWithValue("@CGradeId", argRegister.CGradeId);
                Command.Parameters.AddWithValue("@HGradeId", argRegister.HGradeId);
                Command.Parameters.AddWithValue("@SFDate", argRegister.SFDate);
                Command.Parameters.AddWithValue("@STDate", argRegister.STDate);
                Command.Parameters.AddWithValue("@CFDate", argRegister.CFDate);
                Command.Parameters.AddWithValue("@CTDate", argRegister.CTDate);
                Command.Parameters.AddWithValue("@HFDate", argRegister.HFDate);
                Command.Parameters.AddWithValue("@HTDate", argRegister.HTDate);
                Command.Parameters.AddWithValue("@SLifeTime", argRegister.SLife);
                Command.Parameters.AddWithValue("@CLifeTime", argRegister.CLife);
                Command.Parameters.AddWithValue("@HLifeTime", argRegister.HLife);
                Command.Parameters.AddWithValue("@Remarks", argRegister.Remarks);
                Command.ExecuteNonQuery();

                //Command = new SqlCommand("Update_MaxNo", conn, tran);
                //Command.CommandType = CommandType.StoredProcedure;
                //Command.Parameters.Clear();
                //Command.Parameters.AddWithValue("@TypeId", argTypeId);
                //Command.ExecuteNonQuery();

                tran.Commit();
            }
            catch
            {
                tran.Rollback();
            }
            finally
            {
                conn.Close();
            }
        }
Exemple #6
0
 public void UpdateRegTrans(Vendor.BusinessLayer.RegisterBL argRegister)
 {
     m_oRegister.UpdateRegTrans(argRegister);
 }
Exemple #7
0
 public void InsertRegTrans(Vendor.BusinessLayer.RegisterBL argRegister, int argTypeId)
 {
     m_oRegister.InsertRegTrans(argRegister, argTypeId);
 }
Exemple #8
0
 public void UpdateRegistration(Vendor.BusinessLayer.RegisterBL argRegister)
 {
     m_oRegister.UpdateRegistration(argRegister);
 }
Exemple #9
0
 public void InsertRegistration(Vendor.BusinessLayer.RegisterBL argRegister)
 {
     m_oRegister.InsertRegistration(argRegister);
 }
Exemple #10
0
 public void InsertAssessment(Vendor.BusinessLayer.RegisterBL argRegister)
 {
     m_oRegister.InsertAssessment(argRegister);
 }
Exemple #11
0
        public void UpdateRegistration(int argVendorId)
        {
            Vendor.BusinessLayer.RegUpdateBL oRegUpdate;
            Vendor.BusinessLayer.RegisterBL  oRegister;
            oRegUpdate = new Vendor.BusinessLayer.RegUpdateBL();
            oRegister  = new Vendor.BusinessLayer.RegisterBL();

            DataSet ds = new DataSet();

            ds = oRegister.GetRegUpdateDetails(argVendorId);

            DataTable dtM = new DataTable();
            DataTable dtS = new DataTable();
            DataTable dtC = new DataTable();
            DataTable dtH = new DataTable();

            dtM = ds.Tables[0];
            dtS = ds.Tables[1];
            dtC = ds.Tables[2];
            dtH = ds.Tables[3];

            if (dtM.Rows.Count > 0)
            {
                oRegUpdate.RegisterId = Convert.ToInt32(dtM.Rows[0]["RegisterId"].ToString());
                oRegUpdate.VendorId   = argVendorId;

                oRegUpdate.Supply   = Convert.ToBoolean(dtM.Rows[0]["Supply"].ToString());
                oRegUpdate.Contract = Convert.ToBoolean(dtM.Rows[0]["Contract"].ToString());
                oRegUpdate.Service  = Convert.ToBoolean(dtM.Rows[0]["Contract"].ToString());

                oRegUpdate.STDate = Convert.ToDateTime(dtM.Rows[0]["STDate"].ToString());
                oRegUpdate.CTDate = Convert.ToDateTime(dtM.Rows[0]["HTDate"].ToString());
                oRegUpdate.HTDate = Convert.ToDateTime(dtM.Rows[0]["HTDate"].ToString());

                oRegUpdate.SLife = Convert.ToBoolean(dtM.Rows[0]["SLifeTime"].ToString());
                oRegUpdate.CLife = Convert.ToBoolean(dtM.Rows[0]["CLifeTime"].ToString());
                oRegUpdate.HLife = Convert.ToBoolean(dtM.Rows[0]["HLifeTime"].ToString());

                oRegUpdate.SGradeId = Convert.ToInt32(dtM.Rows[0]["SGradeId"].ToString());
                oRegUpdate.CGradeId = Convert.ToInt32(dtM.Rows[0]["SGradeId"].ToString());
                oRegUpdate.HGradeId = Convert.ToInt32(dtM.Rows[0]["SGradeId"].ToString());
            }

            if (dtS.Rows.Count > 0)
            {
                if (dtS.Rows[0]["StatusType"].ToString() == "R")
                {
                    oRegUpdate.Supply   = true;
                    oRegUpdate.STDate   = Convert.ToDateTime(dtS.Rows[0]["STDate"].ToString());
                    oRegUpdate.SLife    = Convert.ToBoolean(dtS.Rows[0]["SLifeTime"].ToString());
                    oRegUpdate.SGradeId = Convert.ToInt32(dtS.Rows[0]["SGradeId"].ToString());
                }
                else if (dtS.Rows[0]["StatusType"].ToString() == "S")
                {
                    oRegUpdate.SSuspend = true;
                    oRegUpdate.STDate   = Convert.ToDateTime(dtS.Rows[0]["STDate"].ToString());
                }

                else if (dtS.Rows[0]["StatusType"].ToString() == "B")
                {
                    oRegUpdate.SBlackList = true;
                }
            }

            if (dtC.Rows.Count > 0)
            {
                if (dtC.Rows[0]["StatusType"].ToString() == "R")
                {
                    oRegUpdate.Contract = true;
                    oRegUpdate.CTDate   = Convert.ToDateTime(dtC.Rows[0]["CTDate"].ToString());
                    oRegUpdate.CLife    = Convert.ToBoolean(dtC.Rows[0]["CLifeTime"].ToString());
                    oRegUpdate.CGradeId = Convert.ToInt32(dtC.Rows[0]["CGradeId"].ToString());
                }
                else if (dtC.Rows[0]["StatusType"].ToString() == "S")
                {
                    oRegUpdate.CSuspend = true;
                    oRegUpdate.CTDate   = Convert.ToDateTime(dtC.Rows[0]["CTDate"].ToString());
                }

                else if (dtC.Rows[0]["StatusType"].ToString() == "B")
                {
                    oRegUpdate.CBlackList = true;
                }
            }

            if (dtH.Rows.Count > 0)
            {
                if (dtH.Rows[0]["StatusType"].ToString() == "R")
                {
                    oRegUpdate.Service = true;
                    //oRegUpdate.HTDate = Convert.ToDateTime(dtH.Rows[0]["HTDate"].ToString());
                    //oRegUpdate.HLife = Convert.ToBoolean(dtH.Rows[0]["HLifeTime"].ToString());
                    //oRegUpdate.HGradeId = Convert.ToInt32(dtH.Rows[0]["HGradeId"].ToString());
                }
                else if (dtH.Rows[0]["StatusType"].ToString() == "S")
                {
                    oRegUpdate.HSuspend = true;
                    //oRegUpdate.HTDate = Convert.ToDateTime(dtH.Rows[0]["HTDate"].ToString());
                }

                else if (dtH.Rows[0]["StatusType"].ToString() == "B")
                {
                    oRegUpdate.HBlackList = true;
                }
            }
            oRegister.InsertRegTransLatest(oRegUpdate);

            if (clsStatic.g_bTypeSelection == true)
            {
                bool bSupply   = false;
                bool bContract = false;
                bool bService  = false;

                if (oRegUpdate.Supply == true)
                {
                    if (oRegUpdate.SSuspend == true | oRegUpdate.SBlackList == true)
                    {
                        bSupply = false;
                    }
                    else
                    {
                        bSupply = true;
                    }
                }

                if (oRegUpdate.Contract == true)
                {
                    if (oRegUpdate.CSuspend == true | oRegUpdate.CBlackList == true)
                    {
                        bContract = false;
                    }
                    else
                    {
                        bContract = true;
                    }
                }

                if (oRegUpdate.Service == true)
                {
                    if (oRegUpdate.HSuspend == true | oRegUpdate.HBlackList == true)
                    {
                        bService = false;
                    }
                    else
                    {
                        bService = true;
                    }
                }

                UpdateVendorType(oRegUpdate.VendorId, bSupply, bContract, bService);
            }
        }