Esempio n. 1
0
        public Message ChangePassword(User objUser, string vstrNewPassword)
        {
            Message objMessage = new Message();
            try
            {
                DbCommand objCmd = dBase.GetStoredProcCommand("sprocCS_ChangePassword");
                dBase.AddInParameter(objCmd, "@UserID", DbType.Int32, objUser.UserID);
                dBase.AddInParameter(objCmd, "@LoginPassword", DbType.String, objUser.LoginPassword);
                dBase.AddInParameter(objCmd, "@NewPassword", DbType.String, vstrNewPassword);
                dBase.AddOutParameter(objCmd, "@ReturnValue", DbType.Int32, 4);
                dBase.AddOutParameter(objCmd, "@ReturnMessage", DbType.String, 255);
                dBase.ExecuteNonQuery(objCmd);

                objMessage.ReturnValue = (int)dBase.GetParameterValue(objCmd, "@ReturnValue");
                objMessage.ReturnMessage = (string)dBase.GetParameterValue(objCmd, "@ReturnMessage");
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objMessage;
        }
Esempio n. 2
0
        public Message InsertUpdatePlatformUser(User objUser)
        {
            Message objMessage = new Message();
            try
            {
                DbCommand objCmd = dBase.GetStoredProcCommand("sprocCS_InsertUpdatePlatformUser");
                dBase.AddInParameter(objCmd, "@UserID", DbType.Int32, objUser.UserID);
                dBase.AddInParameter(objCmd, "@UserTypeID", DbType.Int32, objUser.UserTypeID);
                dBase.AddInParameter(objCmd, "@FirstName", DbType.String, objUser.FirstName);
                dBase.AddInParameter(objCmd, "@LastName", DbType.String, objUser.LastName);
                dBase.AddInParameter(objCmd, "@CommunicationEmailID", DbType.String, objUser.CommunicationEmailID);
                dBase.AddInParameter(objCmd, "@LoginID", DbType.String, objUser.LoginID);
                dBase.AddInParameter(objCmd, "@LoginPassword", DbType.String, objUser.LoginPassword);
                dBase.AddOutParameter(objCmd, "@ReturnValue", DbType.Int32, 4);
                dBase.AddOutParameter(objCmd, "@ReturnMessage", DbType.String, 255);
                dBase.ExecuteNonQuery(objCmd);

                objMessage.ReturnValue = (int)dBase.GetParameterValue(objCmd, "@ReturnValue");
                objMessage.ReturnMessage = (string)dBase.GetParameterValue(objCmd, "@ReturnMessage");
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objMessage;
        }
Esempio n. 3
0
        public Message InsertUpdatePlatformCustomer(Customer objCustomer)
        {
            Message objMessage = new Message();
            try
            {
                DbCommand objCmd = dBase.GetStoredProcCommand("sprocCS_InsertUpdatePlatformCustomer");
                dBase.AddInParameter(objCmd, "@CustomerID", DbType.Int32, objCustomer.CustomerID);
                dBase.AddInParameter(objCmd, "@FirstName", DbType.String, objCustomer.FirstName);
                dBase.AddInParameter(objCmd, "@LastName", DbType.String, objCustomer.LastName);
                dBase.AddInParameter(objCmd, "@Address", DbType.String, objCustomer.Address);
                dBase.AddInParameter(objCmd, "@ZIP", DbType.String, objCustomer.ZIP);
                dBase.AddInParameter(objCmd, "@City", DbType.String, objCustomer.City);
                dBase.AddInParameter(objCmd, "@Country", DbType.String, objCustomer.Country);
                dBase.AddInParameter(objCmd, "@TeleNumber", DbType.String, objCustomer.TeleNumber);
                dBase.AddInParameter(objCmd, "@Email", DbType.String, objCustomer.Email);
                dBase.AddInParameter(objCmd, "@Notes", DbType.String, objCustomer.Notes);
                dBase.AddInParameter(objCmd, "@CreatedBy", DbType.String, objCustomer.CreatedBy);
                dBase.AddOutParameter(objCmd, "@ReturnValue", DbType.Int32, 4);
                dBase.AddOutParameter(objCmd, "@ReturnMessage", DbType.String, 255);
                dBase.ExecuteNonQuery(objCmd);

                objMessage.ReturnValue = (int)dBase.GetParameterValue(objCmd, "@ReturnValue");
                objMessage.ReturnMessage = (string)dBase.GetParameterValue(objCmd, "@ReturnMessage");
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objMessage;
        }
Esempio n. 4
0
        public Message DeletePlatformCustomer(Customer objCustomer)
        {
            Message objMessage = new Message();
            try
            {
                DbCommand objCmd = dBase.GetStoredProcCommand("sprocCS_DeletePlatformCustomer");
                dBase.AddInParameter(objCmd, "@CustomerID", DbType.Int32, objCustomer.CustomerID);
                dBase.AddOutParameter(objCmd, "@ReturnValue", DbType.Int32, 4);
                dBase.AddOutParameter(objCmd, "@ReturnMessage", DbType.String, 255);
                dBase.ExecuteNonQuery(objCmd);

                objMessage.ReturnValue = (int)dBase.GetParameterValue(objCmd, "@ReturnValue");
                objMessage.ReturnMessage = (string)dBase.GetParameterValue(objCmd, "@ReturnMessage");
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objMessage;
        }
Esempio n. 5
0
        public Message InsertUpdateSaleDetail(Sale objSale)
        {
            Message objMessage = new Message();
            try
            {
                DbCommand objCmd = dBase.GetStoredProcCommand("sprocCS_InsertUpdateSaleDetail");
                dBase.AddInParameter(objCmd, "@SaleID", DbType.Int32, objSale.SaleID);
                dBase.AddInParameter(objCmd, "@ProductID", DbType.Int32, objSale.ProductID);
                dBase.AddInParameter(objCmd, "@SizeID", DbType.Int32, objSale.SizeID);
                dBase.AddInParameter(objCmd, "@Quantity", DbType.Decimal, objSale.Quantity);
                dBase.AddInParameter(objCmd, "@Discount", DbType.Decimal, objSale.Discount);
                dBase.AddInParameter(objCmd, "@DiscountType", DbType.String, objSale.DiscountType);
                dBase.AddInParameter(objCmd, "@Price", DbType.Decimal, objSale.Price);

                dBase.AddOutParameter(objCmd, "@ReturnValue", DbType.Int32, 4);
                dBase.AddOutParameter(objCmd, "@ReturnMessage", DbType.String, 255);
                dBase.ExecuteNonQuery(objCmd);

                objMessage.ReturnValue = (int)dBase.GetParameterValue(objCmd, "@ReturnValue");
                objMessage.ReturnMessage = (string)dBase.GetParameterValue(objCmd, "@ReturnMessage");
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objMessage;
        }
Esempio n. 6
0
        public Message InsertUpdateSaleMaster(Sale objSale)
        {
            Message objMessage = new Message();
            try
            {
                DbCommand objCmd = dBase.GetStoredProcCommand("sprocCS_InsertUpdateSaleMaster");
                dBase.AddInParameter(objCmd, "@SaleID", DbType.Int32, objSale.SaleID);
                dBase.AddInParameter(objCmd, "@CustomerID", DbType.Int32, objSale.CustomerID);
                dBase.AddInParameter(objCmd, "@CFirstName", DbType.String, objSale.CFirstName);
                dBase.AddInParameter(objCmd, "@Address", DbType.String, objSale.Address);
                dBase.AddInParameter(objCmd, "@City", DbType.String, objSale.City);
                dBase.AddInParameter(objCmd, "@ZIP", DbType.String, objSale.ZIP);
                dBase.AddInParameter(objCmd, "@Country", DbType.String, objSale.Country);
                dBase.AddInParameter(objCmd, "@Email", DbType.String, objSale.Email);
                dBase.AddInParameter(objCmd, "@TeleNumber", DbType.String, objSale.TeleNumber);
                dBase.AddInParameter(objCmd, "@SaleNote", DbType.String, objSale.SaleNote);
                dBase.AddInParameter(objCmd, "@CCAmount", DbType.Decimal, objSale.CCAmount);
                dBase.AddInParameter(objCmd, "@BankAmount", DbType.Decimal, objSale.BankAmount);
                dBase.AddInParameter(objCmd, "@Cash", DbType.Decimal, objSale.Cash);
                dBase.AddInParameter(objCmd, "@Discount", DbType.Decimal, objSale.Discount);
                dBase.AddInParameter(objCmd, "@FinalDiscountType", DbType.String, objSale.FinalDiscountType);
                dBase.AddInParameter(objCmd, "@FinalDiscount", DbType.Decimal, objSale.FinalDiscount);
                dBase.AddInParameter(objCmd, "@FinalPayableAmount", DbType.Decimal, objSale.FinalPayableAmount);
                dBase.AddInParameter(objCmd, "@SaleMadeBy", DbType.Int32, objSale.SaleMadeBy);
                dBase.AddInParameter(objCmd, "@ThisSaleDate", DbType.String, objSale.ThisSaleDate);
                dBase.AddOutParameter(objCmd, "@ReturnValue", DbType.Int32, 4);
                dBase.AddOutParameter(objCmd, "@ReturnMessage", DbType.String, 255);
                dBase.ExecuteNonQuery(objCmd);

                objMessage.ReturnValue = (int)dBase.GetParameterValue(objCmd, "@ReturnValue");
                objMessage.ReturnMessage = (string)dBase.GetParameterValue(objCmd, "@ReturnMessage");
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objMessage;
        }