예제 #1
0
        private void UpdateEmployee()
        {
            ObjDAL.UpdateColumnData("EmployeeCode", SqlDbType.NVarChar, txtEmployeeCode.Text.Trim());
            ObjDAL.UpdateColumnData("Name", SqlDbType.NVarChar, txtName.Text.Trim());
            ObjDAL.UpdateColumnData("ShopID", SqlDbType.Int, cmbShop.SelectedValue);
            if (radMale.Checked)
            {
                ObjDAL.UpdateColumnData("Gender", SqlDbType.Bit, true);
            }
            else if (radFemale.Checked)
            {
                ObjDAL.UpdateColumnData("Gender", SqlDbType.Bit, false);
            }
            if (dtpDOB.Checked)
            {
                ObjDAL.UpdateColumnData("DOB", SqlDbType.DateTime, dtpDOB.Value.ToString("yyyy-MM-dd"));
            }
            else
            {
                ObjDAL.UpdateColumnData("DOB", SqlDbType.DateTime, DBNull.Value);
            }


            ObjDAL.UpdateColumnData("Address", SqlDbType.NVarChar, txtAdd.Text.Trim());

            if (PicEmployee.Image != null)
            {
                ObjDAL.UpdateColumnData("Photo", SqlDbType.VarBinary, ObjUtil.GetImageBytes(PicEmployee.Image));
            }

            ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
            ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now);

            if (ObjDAL.UpdateData(clsUtility.DBName + ".dbo.EmployeeDetails", "EMPID = " + EmployeeID + "") > 0)
            {
                //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate, clsUtility.IsAdmin);
                ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate);
                clsUtility.ShowInfoMessage("Employee Record has been updated.", clsUtility.strProjectTitle);

                if (txtUsername.Text.Trim().Length != 0 && txtPass.Text.Trim().Length != 0)
                {
                    UpdateUserDetails();
                }
                LoadData();
                ClearAll();
                grpEmployee.Enabled = false;
                ObjDAL.ResetData();
            }
            else
            {
                clsUtility.ShowErrorMessage("Failed to update the employee data.", clsUtility.strProjectTitle);
                ObjDAL.ResetData();
            }
        }
예제 #2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            //if (ValidateForm())
            //{
            if (DuplicateColor(ID))
            {
                ObjDAL.UpdateColumnData("Size", SqlDbType.VarChar, txtSize.Text);
                ObjDAL.UpdateColumnData("SizeTypeID", SqlDbType.Int, cmbSizeType.SelectedValue);
                ObjDAL.UpdateColumnData("ActiveStatus", SqlDbType.Bit, cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
                ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test
                ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now);

                if (ObjDAL.UpdateData(clsUtility.DBName + ".dbo.SizeMaster", "SizeID = " + ID + "") > 0)
                {
                    //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate, clsUtility.IsAdmin);
                    ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate);

                    clsUtility.ShowInfoMessage(clsUtility.MsgDataUpdated, clsUtility.strProjectTitle);
                    LoadData();
                    ClearAll();
                    grpSizeType.Enabled = false;
                }
                else
                {
                    clsUtility.ShowErrorMessage(clsUtility.MsgDatanotUpdated, clsUtility.strProjectTitle);
                }
            }
            else
            {
                //clsUtility.ShowErrorMessage("'" + txtSize.Text + "' Size is already exist..", clsUtility.strProjectTitle);
                txtSize.Focus();
            }
            ObjDAL.ResetData();
            //}
        }
예제 #3
0
        private void InsertCloseCashBand(DataTable dt)
        {
            DataRow[] drow = dt.Select("Count>0");
            int       ID   = 0;

            for (int i = 0; i < drow.Length; i++)//(int i = 0; i < dt.Rows.Count; i++)
            {
                //ObjDAL.SetColumnData("MasterCashClosingID", SqlDbType.Int, dt.Rows[i]["MasterCashClosingID"]);
                //ObjDAL.SetColumnData("CashBandID", SqlDbType.Int, dt.Rows[i]["CashBandID"]);
                //ObjDAL.SetColumnData("Count", SqlDbType.Int, dt.Rows[i]["Count"] == DBNull.Value ? 0 : dt.Rows[i]["Count"]);
                //ObjDAL.SetColumnData("Value", SqlDbType.Decimal, dt.Rows[i]["Value"] == DBNull.Value ? 0 : dt.Rows[i]["Value"]);

                ObjDAL.SetColumnData("MasterCashClosingID", SqlDbType.Int, drow[i]["MasterCashClosingID"]);
                ObjDAL.SetColumnData("CashBandID", SqlDbType.Int, drow[i]["CashBandID"]);
                ObjDAL.SetColumnData("Count", SqlDbType.Int, drow[i]["Count"] == DBNull.Value ? 0 : drow[i]["Count"]);
                ObjDAL.SetColumnData("Value", SqlDbType.Decimal, drow[i]["Value"] == DBNull.Value ? 0 : drow[i]["Value"]);

                ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID);

                ID = ObjDAL.InsertData(clsUtility.DBName + ".[dbo].[tblCashClosing]", true);
            }
            if (ID > 0)
            {
                ObjDAL.UpdateColumnData("TotalCashValue", SqlDbType.Decimal, Cashtotal);
                ObjDAL.UpdateColumnData("CashStatus", SqlDbType.Int, 1);
                ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID);
                ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now);
                int a = ObjDAL.UpdateData(clsUtility.DBName + ".[dbo].[tblMasterCashClosing]", "MasterCashClosingID=" + pMasterCashClosingID);
                if (a > 0)
                {
                    clsUtility.ShowInfoMessage("Cash Box has been Closed !", clsUtility.strProjectTitle);
                }
            }
            ObjDAL.ResetData();
        }
 private int DataUpdateDeliveryPurchaseBill2(int ID)
 {
     dtSize = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.SizeMaster", "SizeID,Size,SizeTypeID", "ISNULL(ActiveStatus,1) = 1 AND SizeTypeID = " + cmbSizeType.SelectedValue, null);
     for (int i = 3; i < dtPurchaseQTYColor.Columns.Count - 1; i++)
     {
         string    col  = dtPurchaseQTYColor.Columns[i].ColumnName.ToString();
         DataRow[] drow = dtSize.Select("Size = '" + col + "' AND SizeTypeID=" + cmbSizeType.SelectedValue);
         if (drow.Length > 0)
         {
             ObjDAL.UpdateColumnData("Col" + (i - 2), SqlDbType.Int, drow[0]["SizeID"].ToString());
         }
     }
     ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
     ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now);
     return(ObjDAL.UpdateData(clsUtility.DBName + ".dbo.DeliveryPurchaseBill2", "DeliveryPurchaseID1=" + ID));
 }
예제 #5
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (Validateform())
            {
                if (DuplicateUser(0))
                {
                    ObjDAL.UpdateColumnData("BrandName", SqlDbType.NVarChar, txtBrandName.Text.Trim());
                    ObjDAL.UpdateColumnData("SupplierID", SqlDbType.Int, cmbSupplier.SelectedValue);
                    ObjDAL.UpdateColumnData("ActiveStatus", SqlDbType.Bit, cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
                    ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test
                    ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now);

                    if (ObjDAL.UpdateData(clsUtility.DBName + ".dbo.BrandMaster", "BrandID = " + ID) > 0)
                    {
                        //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate, clsUtility.IsAdmin);
                        ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate);

                        clsUtility.ShowInfoMessage("'" + txtBrandName.Text + "' Brand is Updated", clsUtility.strProjectTitle);
                        LoadData();
                        ClearAll();
                        grpBrand.Enabled = false;
                    }
                    else
                    {
                        clsUtility.ShowErrorMessage("'" + txtBrandName.Text + "' Brand is not Updated", clsUtility.strProjectTitle);
                    }
                }
                else
                {
                    clsUtility.ShowErrorMessage("'" + txtBrandName.Text + "' Brand is already exist..", clsUtility.strProjectTitle);
                    txtBrandName.Focus();
                }
                ObjDAL.ResetData();
            }
        }
예제 #6
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (Validateform())
            {
                if (DuplicateUser(ID))
                {
                    ObjDAL.UpdateColumnData("CountryID", SqlDbType.Int, cmbCountry.SelectedValue);
                    ObjDAL.UpdateColumnData("CurrencyCode", SqlDbType.NVarChar, txtCurrencyCode.Text);
                    ObjDAL.UpdateColumnData("CurrencyName", SqlDbType.NVarChar, txtCurrencyName.Text);
                    ObjDAL.UpdateColumnData("CurrencyRate", SqlDbType.Decimal, txtCurrencyRate.Text);
                    ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test
                    ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now);
                    if (ObjDAL.UpdateData(clsUtility.DBName + ".dbo.CurrencyRateSetting", "CurrencyRateID = " + ID + "") > 0)
                    {
                        ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate, clsUtility.IsAdmin);

                        clsUtility.ShowInfoMessage("Currency Rate for '" + cmbCountry.Text + "' is not Updated", clsUtility.strProjectTitle);
                        LoadData();
                        ClearAll();
                        grpCurrencyValue.Enabled = false;
                    }
                    else
                    {
                        clsUtility.ShowInfoMessage("Currency Rate for '" + cmbCountry.Text + "' is not Updated", clsUtility.strProjectTitle);
                    }
                }
                else
                {
                    clsUtility.ShowErrorMessage("Currency Rate for '" + cmbCountry.Text + "' is already exist..", clsUtility.strProjectTitle);
                    cmbCountry.Focus();
                }
                ObjDAL.ResetData();
            }
        }
예제 #7
0
        private void UpdateUserDetails()
        {
            ObjDAL.UpdateColumnData("UserName", SqlDbType.NVarChar, txtUsername.Text.Trim());
            ObjDAL.UpdateColumnData("Password", SqlDbType.NVarChar, ObjUtil.Encrypt(txtPass.Text.Trim(), true));
            ObjDAL.UpdateColumnData("EmailID", SqlDbType.NVarChar, txtEmail.Text.Trim());
            //ObjDAL.UpdateColumnData("IsAdmin", SqlDbType.Bit, false);
            //if user is blocked then if his details will update from this form then could be auto unblock

            //ObjDAL.UpdateColumnData("IsBlock", SqlDbType.Bit, false);
            if (ObjDAL.UpdateData(clsUtility.DBName + ".dbo.UserManagement", "EmployeeID = " + EmployeeID + "") > 0)
            {
                //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate, clsUtility.IsAdmin);
                ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate);
                clsUtility.ShowInfoMessage("User Login Record has been updated.", clsUtility.strProjectTitle);
                LoadData();
                ClearAll();
                grpEmployee.Enabled = false;
                ObjDAL.ResetData();
            }
            else
            {
                clsUtility.ShowErrorMessage("Failed to update the User Login Data.", clsUtility.strProjectTitle);
                ObjDAL.ResetData();
            }
        }
예제 #8
0
        private void AddStatusDate()
        {
            DataTable dt = ObjDAL.GetData(clsUtility.DBName + ".dbo.RegistrationDetails", "PcName='" + Environment.MachineName + "'", "RegistrationID");

            if (dt != null && dt.Rows.Count > 0)
            {
                DateTime status  = Convert.ToDateTime(ObjUtil.Decrypt(dt.Rows[0]["StatusDate"].ToString(), true));
                DateTime ExpDate = Convert.ToDateTime(ObjUtil.Decrypt(dt.Rows[0]["ExpiryDate"].ToString(), true));

                //if (dt.Rows[0]["StatusDate"] != DBNull.Value && Convert.ToDateTime(dt.Rows[0]["StatusDate"]) <= DateTime.Now && Convert.ToDateTime(dt.Rows[0]["ExpiryDate"]) >= DateTime.Now)
                if (dt.Rows[0]["StatusDate"] != DBNull.Value && status <= ExpDate)
                {
                    if (status <= Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd h:mm:ss tt")))
                    {
                        ObjDAL.UpdateColumnData("StatusDate", SqlDbType.VarChar, ObjUtil.Encrypt(DateTime.Now.ToString(), true));
                        ObjDAL.UpdateData(clsUtility.DBName + ".dbo.RegistrationDetails", "PcName='" + Environment.MachineName + "'");
                    }
                }
                if (dt.Rows[0]["SoftKey"] == DBNull.Value)
                {
                    lblStatus.Text = lblStatus.Text + " UnRegistered Version";
                }
                else
                {
                    lblStatus.Text = lblStatus.Text + " Registered Version";
                }
            }
            else
            {
                lblStatus.Text = lblStatus.Text + " UnRegistered Version";
            }
        }
예제 #9
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (clsFormRights.HasFormRight(clsFormRights.Forms.frmOtherSetting, clsFormRights.Operation.Save) || clsUtility.IsAdmin)
            {
                //DataTable dtFooterNote = ObjDAL.ExecuteSelectStatement("SELECT COUNT(1) FROM " + clsUtility.DBName + ".[dbo].[DefaultStoreSetting] WITH(NOLOCK)");

                int a = ObjDAL.CountRecords(clsUtility.DBName + ".[dbo].[DefaultStoreSetting]");
                if (a > 0) // if data found for the PC thenupdate
                {
                    //ObjDAL.ExecuteNonQuery("UPDATE " + clsUtility.DBName + ".dbo.DefaultStoreSetting SET InvoiceFooterNote =N'" + txtFooterNote.Text + "', UserArabicNumbers='" + chkArabicPrice.Checked.ToString() + "', ImagePath='" + txtImagePath.Text + "', Extension='" + GetExtension() + "'");

                    ObjDAL.UpdateColumnData("InvoiceFooterNote", SqlDbType.NVarChar, "N" + txtFooterNote.Text);
                    ObjDAL.UpdateColumnData("UserArabicNumbers", SqlDbType.Bit, chkArabicPrice.Checked);
                    ObjDAL.UpdateColumnData("ImagePath", SqlDbType.NVarChar, txtImagePath.Text);
                    ObjDAL.UpdateColumnData("Extension", SqlDbType.NVarChar, GetExtension());
                    ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID);
                    ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                    ObjDAL.UpdateColumnData("SalesManIDMandatory ", SqlDbType.Bit, chkSalesManName.Checked);
                    ObjDAL.UpdateColumnData("CustMobileMandatory ", SqlDbType.Bit, chkCustomerMobile.Checked);
                    ObjDAL.UpdateData(clsUtility.DBName + ".dbo.DefaultStoreSetting", "1=1");

                    clsUtility.ShowInfoMessage("Settings has been updated.", clsUtility.strProjectTitle);
                }
                else
                {
                    // else insert.
                    ObjDAL.SetColumnData("InvoiceFooterNote", SqlDbType.NVarChar, "N" + txtFooterNote.Text);
                    ObjDAL.SetColumnData("UserArabicNumbers", SqlDbType.Bit, chkArabicPrice.Checked);
                    ObjDAL.SetColumnData("ImagePath", SqlDbType.NVarChar, txtImagePath.Text);
                    ObjDAL.SetColumnData("Extension", SqlDbType.NVarChar, GetExtension());
                    ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID);
                    ObjDAL.SetColumnData("SalesManIDMandatory ", SqlDbType.Bit, chkSalesManName.Checked);
                    ObjDAL.SetColumnData("CustMobileMandatory ", SqlDbType.Bit, chkCustomerMobile.Checked);

                    int r = ObjDAL.InsertData(clsUtility.DBName + ".[dbo].[DefaultStoreSetting]", false);
                    if (r > 0)
                    {
                        clsUtility.ShowInfoMessage("Settings has been saved.", clsUtility.strProjectTitle);
                    }
                    lblmsg.Visible = false;
                }


                Sales_Invoice._Is_SalesManIDMandat     = chkSalesManName.Checked;
                Sales_Invoice._Is_CustomerMobileMandat = chkCustomerMobile.Checked;
            }
        }
예제 #10
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (clsFormRights.HasFormRight(clsFormRights.Forms.Purchase_Invoice, clsFormRights.Operation.Update) || clsUtility.IsAdmin)
            {
                if (Validateform())
                {
                    if (DuplicateUser(ID))
                    {
                        ObjDAL.UpdateColumnData("SupplierBillNo", SqlDbType.VarChar, txtSupplierBillNo.Text.Trim());
                        ObjDAL.UpdateColumnData("ShipmentNo", SqlDbType.VarChar, txtShipmentNo.Text.Trim());
                        ObjDAL.UpdateColumnData("BillValue", SqlDbType.Decimal, txtBillValue.Text.Trim());
                        ObjDAL.UpdateColumnData("TotalQTY", SqlDbType.Int, txtTotalQTY.Text.Trim());
                        ObjDAL.UpdateColumnData("SupplierID", SqlDbType.Int, cmbSupplier.SelectedValue);
                        ObjDAL.UpdateColumnData("BillDate", SqlDbType.Date, dtpBillDate.Value.ToString("yyyy-MM-dd"));
                        ObjDAL.UpdateColumnData("Discount", SqlDbType.Decimal, txtForeignDiscount.Text.Length > 0 ? Convert.ToDecimal(txtForeignDiscount.Text) : 0);
                        ObjDAL.UpdateColumnData("ForeignExp", SqlDbType.Decimal, txtForeignExp.Text.Length > 0 ? Convert.ToDecimal(txtForeignExp.Text) : 0);
                        ObjDAL.UpdateColumnData("GrandTotal", SqlDbType.Decimal, txtNetValue.Text.Trim());

                        ObjDAL.UpdateColumnData("LocalValue", SqlDbType.Decimal, txtLocalValue.Text.Trim());
                        ObjDAL.UpdateColumnData("LocalExp", SqlDbType.Decimal, txtLocalExp.Text.Length > 0 ? Convert.ToDecimal(txtLocalExp.Text) : 0);
                        ObjDAL.UpdateColumnData("LocalBillValue", SqlDbType.Decimal, txtLocalBillValue.Text.Trim());

                        ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test
                        ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now);

                        if (ObjDAL.UpdateData(clsUtility.DBName + ".dbo.PurchaseInvoice", "PurchaseInvoiceID = " + ID + "") > 0)
                        {
                            //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate, clsUtility.IsAdmin);
                            ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate);

                            clsUtility.ShowInfoMessage("Purchase Invoice for '" + cmbSupplier.Text + "' is Updated", clsUtility.strProjectTitle);
                            LoadData();
                            ClearAll();
                            grpPurchaseInvoice.Enabled = false;

                            grpPurchaseInvoice.Enabled = false;
                            grpForeignCurrency.Enabled = false;
                            grpLocalCurrency.Enabled   = false;
                        }
                        else
                        {
                            clsUtility.ShowInfoMessage("Purchase Invoice for '" + cmbSupplier.Text + "' is not Updated", clsUtility.strProjectTitle);
                        }
                    }
                    else
                    {
                        clsUtility.ShowErrorMessage("Purchase Invoice for '" + cmbSupplier.Text + "' is already exist..", clsUtility.strProjectTitle);
                        cmbSupplier.Focus();
                    }
                    ObjDAL.ResetData();
                }
            }
            else
            {
                clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
            }
        }
예제 #11
0
 private void frmHome_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (!IsLogOut)
     {
         bool b = clsUtility.ShowQuestionMessage("Are you sure, you want to Exit?", clsUtility.strProjectTitle);
         if (b)
         {
             ObjDAL.UpdateColumnData("LogOutTime", SqlDbType.DateTime, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
             ObjDAL.UpdateData(clsUtility.DBName + ".dbo.Login_History", "Login_History_ID = " + Login_History_ID);
             IsLogOut = true;
             Application.Exit();
         }
         else
         {
             e.Cancel = true;
         }
     }
 }
예제 #12
0
 private void DataSave()
 {
     try
     {
         ObjDAL.UpdateColumnData("SoftKey", SqlDbType.VarChar, txtEncKey.Text.Trim());
         ObjDAL.UpdateColumnData("ExpiryDate", SqlDbType.VarChar, Objutil.Encrypt(dtpExpiryDate.Value.ToString(), true));
         ObjDAL.UpdateColumnData("IsTrail", SqlDbType.Bit, Istrial.Checked);
         if (clsUtility.DBName.Length > 0)
         {
             ObjDAL.UpdateData(clsUtility.DBName + ".dbo.RegistrationDetails", "PcName='" + Environment.MachineName + "'");
         }
         else
         {
             ObjDAL.UpdateData("dbo.RegistrationDetails", "PcName='" + Environment.MachineName + "'");
         }
     }
     catch (Exception ex)
     {
         clsUtility.ShowErrorMessage(ex.Message);
     }
 }
예제 #13
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (txtPCName.Text.Trim().Length == 0)
            {
                clsUtility.ShowInfoMessage("Please enter PC name.", clsUtility.strProjectTitle);
                txtPCName.Focus();
                return;
            }
            else if (cmbStoreCategory.SelectedIndex == -1)
            {
                clsUtility.ShowInfoMessage("Please Select Store Category.", clsUtility.strProjectTitle);
                cmbStoreCategory.Focus();
                return;
            }
            else if (cmbStoreName.SelectedIndex == -1)
            {
                clsUtility.ShowInfoMessage("Please Select Store Name.", clsUtility.strProjectTitle);
                cmbStoreName.Focus();
                return;
            }

            int result = ObjCon.ExecuteScalarInt("SELECT count(1) FROM " + clsUtility.DBName + ".[dbo].[DefaultStoreSetting] WITH(NOLOCK) WHERE MachineName='" + txtPCName.Text + "'");

            if (result > 0) // if data found for the PC thenupdate
            {
                ObjCon.UpdateColumnData("StoreID", SqlDbType.Int, cmbStoreName.SelectedValue);
                ObjCon.UpdateColumnData("MachineName", SqlDbType.NVarChar, txtPCName.Text);
                ObjCon.UpdateColumnData("StoreCategory", SqlDbType.Int, cmbStoreCategory.SelectedIndex);

                int r = ObjCon.UpdateData(clsUtility.DBName + ".[dbo].[DefaultStoreSetting]", "MachineName='" + txtPCName.Text + "'");
                if (r > 0)
                {
                    clsUtility.ShowInfoMessage("Default store settings has been updated.", clsUtility.strProjectTitle);
                }
            }
            else
            {
                // else insert.
                ObjCon.SetColumnData("StoreID", SqlDbType.Int, cmbStoreName.SelectedValue);
                ObjCon.SetColumnData("MachineName", SqlDbType.NVarChar, txtPCName.Text);
                ObjCon.SetColumnData("StoreCategory", SqlDbType.Int, cmbStoreCategory.SelectedIndex);

                int r = ObjCon.InsertData(clsUtility.DBName + ".[dbo].[DefaultStoreSetting]", false);
                if (r > 0)
                {
                    clsUtility.ShowInfoMessage("Default store settings has been saved.", clsUtility.strProjectTitle);
                }
                lblmsg.Visible = false;
            }
        }
예제 #14
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (Validateform())
            {
                if (DuplicateUser(ID))
                {
                    string pass = ObjUtil.Encrypt(txtPassword.Text, true);
                    ObjDAL.UpdateColumnData("UserName", SqlDbType.NVarChar, txtUserName.Text);
                    ObjDAL.UpdateColumnData("Password", SqlDbType.NVarChar, pass);
                    ObjDAL.UpdateColumnData("EmailID", SqlDbType.VarChar, txtEmail.Text);
                    ObjDAL.UpdateColumnData("SecurityQuestion", SqlDbType.NVarChar, cmbSecurity.SelectedItem.ToString());
                    ObjDAL.UpdateColumnData("Answer", SqlDbType.NVarChar, ObjUtil.Encrypt(txtAsnwer.Text.Trim(), true));
                    ObjDAL.UpdateColumnData("IsAdmin", SqlDbType.Bit, rdAdmin.Checked == true ? 1 : 0);
                    ObjDAL.UpdateColumnData("ActiveStatus", SqlDbType.Bit, rdActive.Checked == true ? 1 : 0);
                    if (rdAdmin.Checked == false)
                    {
                        admin = false;
                        clsUtility.IsAdmin = admin;
                    }

                    if (UserName != txtUserName.Text.Trim() || txtVerifyPassword.Text.Trim() != ObjUtil.Decrypt(pass, true) || rdAdmin.Checked || rdLimitedUser.Checked)
                    {
                        ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, LogID); //if LogID=0 then Test Admin else user
                    }
                    if (ObjDAL.UpdateData(DBName + ".dbo.UserManagement", "UserID=" + ID) > 0)
                    {
                        ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate, admin);
                        LoadData();
                        ClearAll();
                        EnableDisable(false);
                        clsUtility.ShowInfoMessage("'" + UserName + "' user is Updated", clsUtility.strProjectTitle);
                    }
                    else
                    {
                        clsUtility.ShowErrorMessage("'" + UserName + "' user is not Updated", clsUtility.strProjectTitle);
                    }
                    ObjDAL.ResetData();
                }
                else
                {
                    clsUtility.ShowErrorMessage("'" + txtUserName.Text + "' UserName OR EmailID is already exist..", clsUtility.strProjectTitle);
                    txtUserName.Focus();
                }
            }
        }
예제 #15
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (clsFormRights.HasFormRight(clsFormRights.Forms.Supplier_Details, clsFormRights.Operation.Update) || clsUtility.IsAdmin)
            {
                if (Validateform())
                {
                    if (DuplicateUser(ID))
                    {
                        ObjDAL.UpdateColumnData("SupplierName", SqlDbType.NVarChar, txtSupplierName.Text.Trim());
                        ObjDAL.UpdateColumnData("CountryID", SqlDbType.Int, cmbCountry.SelectedValue);
                        ObjDAL.UpdateColumnData("Phone", SqlDbType.VarChar, txtPhone.Text.Trim());
                        ObjDAL.UpdateColumnData("EmailID", SqlDbType.VarChar, txtEmail.Text.Trim());
                        ObjDAL.UpdateColumnData("BankName", SqlDbType.NVarChar, txtBankName.Text.Trim());
                        ObjDAL.UpdateColumnData("BankAccountNo", SqlDbType.VarChar, txtBankAccNo.Text.Trim());
                        ObjDAL.UpdateColumnData("BankAddress", SqlDbType.NVarChar, txtBankAdd.Text.Trim());
                        ObjDAL.UpdateColumnData("ActiveStatus", SqlDbType.Bit, cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
                        ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test
                        ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

                        if (ObjDAL.UpdateData(clsUtility.DBName + ".dbo.SupplierMaster", "SupplierID = " + ID) > 0)
                        {
                            ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate);

                            clsUtility.ShowInfoMessage("'" + txtSupplierName.Text + "' Supplier is Updated", clsUtility.strProjectTitle);
                            LoadData();
                            ClearAll();
                            grpSupplier.Enabled = false;
                        }
                        else
                        {
                            clsUtility.ShowErrorMessage("'" + txtSupplierName.Text + "' Supplier is not Updated", clsUtility.strProjectTitle);
                        }
                        ObjDAL.ResetData();
                    }
                    else
                    {
                        clsUtility.ShowErrorMessage("'" + txtSupplierName.Text + "' Supplier is already exist..", clsUtility.strProjectTitle);
                        txtSupplierName.Focus();
                    }
                }
            }
            else
            {
                clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
            }
        }
예제 #16
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (clsFormRights.HasFormRight(clsFormRights.Forms.Size_Type_Master, clsFormRights.Operation.Update) || clsUtility.IsAdmin)
            {
                if (Validateform())
                {
                    if (DuplicateUser(ID))
                    {
                        ObjDAL.UpdateColumnData("SizeTypeName", SqlDbType.NVarChar, txtSizeTypeName.Text.Trim());
                        //if (cmbDepartment.SelectedIndex >= 0)
                        //{
                        ObjDAL.UpdateColumnData("CategoryID", SqlDbType.Int, cmbDepartment.SelectedValue);
                        //}
                        ObjDAL.UpdateColumnData("ActiveStatus", SqlDbType.Bit, cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
                        ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test
                        ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

                        if (ObjDAL.UpdateData(clsUtility.DBName + ".dbo.SizeTypeMaster", "SizeTypeID = " + ID) > 0)
                        {
                            //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate, clsUtility.IsAdmin);
                            ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate);

                            clsUtility.ShowInfoMessage("'" + txtSizeTypeName.Text + "' Size Type is Updated", clsUtility.strProjectTitle);
                            LoadData();
                            ClearAll();
                            grpSizeTypeDetails.Enabled = false;
                        }
                        else
                        {
                            clsUtility.ShowErrorMessage("'" + txtSizeTypeName.Text + "' Size Type is not Updated", clsUtility.strProjectTitle);
                        }
                        ObjDAL.ResetData();
                    }
                    else
                    {
                        clsUtility.ShowErrorMessage("'" + txtSizeTypeName.Text + "' Size Type is already exist..", clsUtility.strProjectTitle);
                        txtSizeTypeName.Focus();
                    }
                }
            }
            else
            {
                clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
            }
        }
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         KillbackupDatabase();//closing auto database backup service
         if (Directory.Exists(txtBacupPath.Text))
         {
             if (ObjDAL.CountRecords(clsUtility.DBName + ".dbo.BackupConfig  ") > 0)
             {
                 ObjDAL.UpdateColumnData("Path", SqlDbType.NVarChar, txtBacupPath.Text.Trim());
                 //ObjDAL.UpdateColumnData("Date", SqlDbType.Date, dateTimePicker1.Value);
                 ObjDAL.UpdateColumnData("Date", SqlDbType.Date, dateTimePicker2.Value);
                 ObjDAL.UpdateColumnData("Time", SqlDbType.DateTime, dateTimePicker2.Value);
                 int a = ObjDAL.UpdateData(clsUtility.DBName + ".dbo.BackupConfig", "BackupID=1");
                 if (a > 0)
                 {
                     clsUtility.ShowInfoMessage("Backup Configure Successfully.", clsUtility.strProjectTitle);
                 }
             }
             else
             {
                 ObjDAL.SetColumnData("Path", SqlDbType.NVarChar, txtBacupPath.Text.Trim());
                 ObjDAL.SetColumnData("Date", SqlDbType.Date, dateTimePicker1.Value);
                 ObjDAL.SetColumnData("Time", SqlDbType.DateTime, dateTimePicker2.Value);
                 ObjDAL.SetColumnData("IsAutoBackup", SqlDbType.Bit, 1);
                 int a = ObjDAL.InsertData(clsUtility.DBName + ".dbo.BackupConfig", false);
                 if (a > 0)
                 {
                     clsUtility.ShowInfoMessage("Backup Configure Successfully.", clsUtility.strProjectTitle);
                 }
             }
         }
         else
         {
             clsUtility.ShowErrorMessage("Path is not exist", clsUtility.strProjectTitle);
             return;
         }
         inc++;
         this.Size          = new Size(364, 446);
         btnAutoBackup.Text = "Configure Auto Backup >>";
         StartBackupService();
     }
     catch (Exception ex) { clsUtility.ShowInfoMessage(ex.ToString(), clsUtility.strProjectTitle); }
 }
예제 #18
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (clsFormRights.HasFormRight(clsFormRights.Forms.Brand_Master, clsFormRights.Operation.Update) || clsUtility.IsAdmin)
            {
                if (Validateform())
                {
                    if (DuplicateUser(ID))
                    {
                        ObjDAL.UpdateColumnData("CashBand", SqlDbType.Decimal, txtCashBand.Text.Trim());
                        ObjDAL.UpdateColumnData("ActiveStatus", SqlDbType.Bit, cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
                        ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test
                        ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

                        if (ObjDAL.UpdateData(clsUtility.DBName + ".dbo.tblCloseCashBandMaster", "CashBandID = " + ID) > 0)
                        {
                            //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate, clsUtility.IsAdmin);
                            ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate);

                            clsUtility.ShowInfoMessage("'" + txtCashBand.Text + "' CashBand is Updated", clsUtility.strProjectTitle);
                            LoadData();
                            ClearAll();
                            grpClosingBALMaster.Enabled = false;
                        }
                        else
                        {
                            clsUtility.ShowErrorMessage("'" + txtCashBand.Text + "' CashBand is not Updated", clsUtility.strProjectTitle);
                        }
                    }
                    else
                    {
                        clsUtility.ShowErrorMessage("'" + txtCashBand.Text + "' CashBand is already exist..", clsUtility.strProjectTitle);
                        txtCashBand.Focus();
                    }
                    ObjDAL.ResetData();
                }
            }
            else
            {
                clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
            }
        }
예제 #19
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (Validateform())
            {
                if (DuplicateUser(ID))
                {
                    ObjDAL.UpdateColumnData("ProductName", SqlDbType.NVarChar, txtProductName.Text.Trim());
                    ObjDAL.UpdateColumnData("CategoryID", SqlDbType.Int, cmbCategory.SelectedValue);
                    ObjDAL.UpdateColumnData("ActiveStatus", SqlDbType.Bit, cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
                    ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test
                    ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now);
                    if (PicProductMaster.Image != null)
                    {
                        ObjDAL.UpdateColumnData("Photo", SqlDbType.VarBinary, ObjUtil.GetImageBytes(PicProductMaster.Image));
                    }
                    if (ObjDAL.UpdateData(clsUtility.DBName + ".dbo.ProductMaster", "ProductID = " + ID + "") > 0)
                    {
                        //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate, clsUtility.IsAdmin);
                        ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate);

                        clsUtility.ShowInfoMessage("'" + txtProductName.Text + "' Product is Updated", clsUtility.strProjectTitle);
                        LoadData();
                        ClearAll();
                        grpProduct.Enabled = false;
                        ObjDAL.ResetData();
                    }
                    else
                    {
                        clsUtility.ShowErrorMessage("'" + txtProductName.Text + "' Product is not Updated", clsUtility.strProjectTitle);
                        ObjDAL.ResetData();
                    }
                }
                else
                {
                    clsUtility.ShowErrorMessage("'" + txtProductName.Text + "' Product is already exist..", clsUtility.strProjectTitle);
                    txtProductName.Focus();
                    ObjDAL.ResetData();
                }
            }
        }
예제 #20
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     if (Validateform())
     {
         if (DuplicateUser(ID))
         {
             ObjDAL.UpdateColumnData("StoreName", SqlDbType.NVarChar, txtStoreName.Text.Trim());
             ObjDAL.UpdateColumnData("Tel", SqlDbType.VarChar, txtTel.Text.Trim());
             ObjDAL.UpdateColumnData("Fax", SqlDbType.VarChar, txtFax.Text.Trim());
             ObjDAL.UpdateColumnData("Place", SqlDbType.NVarChar, txtPlace.Text.Trim());
             ObjDAL.UpdateColumnData("StoreCategory", SqlDbType.Int, cmbStoreCat.SelectedIndex);
             ObjDAL.UpdateColumnData("ActiveStatus", SqlDbType.Bit, cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
             ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test
             ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now);
             if (ObjDAL.UpdateData(clsUtility.DBName + ".dbo.StoreMaster", "StoreID = " + ID + "") > 0)
             {
                 //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate, clsUtility.IsAdmin);
                 ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate);
                 clsUtility.ShowInfoMessage("'" + txtStoreName.Text + "' Store is Updated", clsUtility.strProjectTitle);
                 LoadData();
                 ClearAll();
                 grpStore.Enabled = false;
                 ObjDAL.ResetData();
             }
             else
             {
                 clsUtility.ShowErrorMessage("'" + txtStoreName.Text + "' Store is not Updated", clsUtility.strProjectTitle);
                 ObjDAL.ResetData();
             }
         }
         else
         {
             clsUtility.ShowErrorMessage("'" + txtStoreName.Text + "' Store is already exist..", clsUtility.strProjectTitle);
             txtStoreName.Focus();
             ObjDAL.ResetData();
         }
     }
 }
예제 #21
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (clsFormRights.HasFormRight(clsFormRights.Forms.Purchase_Bill_Details, clsFormRights.Operation.Save) || clsUtility.IsAdmin)
            {
                DataTable dtPurchaseInvoiceBill = (DataTable)dataGridView1.DataSource;
                if (ObjUtil.ValidateTable(dtPurchaseInvoiceBill))
                {
                    int  _ID = 0;
                    bool b   = false;
                    for (int i = 0; i < dtPurchaseInvoiceBill.Rows.Count; i++)
                    {
                        _ID = 0;
                        ObjDAL.SetColumnData("PurchaseInvoiceID", SqlDbType.Int, PurchaseInvoiceID);
                        ObjDAL.SetColumnData("SupplierBillNo", SqlDbType.NVarChar, txtSupplierBillNo.Text.Trim());
                        ObjDAL.SetColumnData("SupplierID", SqlDbType.Int, cmbSupplier.SelectedValue);
                        ObjDAL.SetColumnData("BillDate", SqlDbType.Date, dtpBillDate.Value.ToString("yyyy-MM-dd"));
                        ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
                        _ProductID = Convert.ToInt32(dtPurchaseInvoiceBill.Rows[i]["ProductID"]);
                        ObjDAL.SetColumnData("ProductID", SqlDbType.Int, _ProductID);
                        ObjDAL.SetColumnData("ModelNo", SqlDbType.NVarChar, dtPurchaseInvoiceBill.Rows[i]["ModelNo"].ToString());
                        ObjDAL.SetColumnData("BrandID", SqlDbType.Int, dtPurchaseInvoiceBill.Rows[i]["BrandID"].ToString());
                        _QTY = Convert.ToInt32(dtPurchaseInvoiceBill.Rows[i]["QTY"]);
                        ObjDAL.SetColumnData("QTY", SqlDbType.Int, _QTY);
                        ObjDAL.SetColumnData("Rate", SqlDbType.Decimal, dtPurchaseInvoiceBill.Rows[i]["Rate"].ToString());
                        ObjDAL.SetColumnData("Sales_Price", SqlDbType.Decimal, dtPurchaseInvoiceBill.Rows[i]["EndUser"].ToString());
                        ObjDAL.SetColumnData("AddedRatio", SqlDbType.Int, dtPurchaseInvoiceBill.Rows[i]["AddedRatio"].ToString());
                        ObjDAL.SetColumnData("SuppossedPrice", SqlDbType.Decimal, dtPurchaseInvoiceBill.Rows[i]["SuppossedPrice"].ToString());

                        _ID = ObjDAL.InsertData(clsUtility.DBName + ".dbo.PurchaseInvoiceDetails", true);

                        //Updating Sales price in Product Master table for sales window
                        ObjDAL.UpdateColumnData("Rate", SqlDbType.Decimal, dtPurchaseInvoiceBill.Rows[i]["EndUser"]);
                        ObjDAL.UpdateData(clsUtility.DBName + ".dbo.ProductMaster", "ProductID = " + _ProductID + "");
                    }

                    if (_ID > 0)
                    {
                        //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
                        ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
                        if (txtDiffQty.Text == "0" && txtDiffValue.Text == "0")
                        {
                            clsUtility.ShowInfoMessage("Purchase Invoice is Saved Successfully..", clsUtility.strProjectTitle);
                        }
                        ClearAll();
                        grpPurchaseBillDetail.Enabled = false;
                    }
                    else
                    {
                        clsUtility.ShowInfoMessage("Purchase Invoice is not Saved Successfully..", clsUtility.strProjectTitle);
                    }
                    ObjDAL.ResetData();
                }
                else
                {
                    //ObjDAL.UpdateColumnData("SupplierBillNo", SqlDbType.VarChar, txtSupplierBillNo.Text.Trim());
                    //ObjDAL.UpdateColumnData("ProductID", SqlDbType.Int, txtProductID.Text.Trim());
                    //ObjDAL.UpdateColumnData("ModelNo", SqlDbType.NVarChar, txtModelNo.Text.Trim());
                    //ObjDAL.UpdateColumnData("BrandID", SqlDbType.Int, cmbBrand.SelectedValue);
                    //ObjDAL.UpdateColumnData("QTY", SqlDbType.Int, txtQTY.Text);
                    //ObjDAL.UpdateColumnData("Rate", SqlDbType.Decimal, txtRate.Text.Trim());
                    //ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test
                    //ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now);

                    //if (ObjDAL.UpdateData(clsUtility.DBName + ".dbo.PurchaseInvoiceDetails", "PurchaseInvoiceID = " + PurchaseInvoiceID + "") > 0)
                    //{
                    //    ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate, clsUtility.IsAdmin);
                    //    ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterUpdate);

                    //    clsUtility.ShowInfoMessage("Purchase Invoice for '" + cmbSupplier.SelectedItem + "' is Updated", clsUtility.strProjectTitle);
                    //    ClearAll();
                    //    grpPurchaseBillDetail.Enabled = false;
                    //    ObjDAL.ResetData();
                    //}
                    //else
                    //{
                    //    clsUtility.ShowInfoMessage("Purchase Invoice for '" + cmbSupplier.SelectedItem + "' is not Updated", clsUtility.strProjectTitle);
                    //    ObjDAL.ResetData();
                    //}
                }
            }
            else
            {
                clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
            }
            dataGridView1.DataSource = dtPurchaseInvoice;
        }
예제 #22
0
        private string TransferStock()
        {
            string _BillNumber = "";

            if (Bill_ID.Trim().Length == 0)
            {
                _BillNumber = GenerateBillNumber();

                ObjDAL.SetColumnData("BillNo", SqlDbType.NVarChar, _BillNumber);
                ObjDAL.SetColumnData("FromStore", SqlDbType.Int, cmdFrom.SelectedValue);
                ObjDAL.SetColumnData("ToStore", SqlDbType.Int, cmdTo.SelectedValue);
                ObjDAL.SetColumnData("BillStatus", SqlDbType.NVarChar, lblBillStatus.Text);
                ObjDAL.SetColumnData("TotalQTY", SqlDbType.Int, txtTotalQTY.Text);
                ObjDAL.SetColumnData("BillDate", SqlDbType.Date, dtpSalesDate.Value.ToString("yyyy-MM-dd"));
                ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID);

                int TransferID = ObjDAL.InsertData(clsUtility.DBName + ".dbo.tblStoreTransferBillDetails", true);

                if (TransferID > 0)
                {
                    for (int i = 0; i < dgvProductDetails.Rows.Count; i++)
                    {
                        string Total        = dgvProductDetails.Rows[i].Cells["Total"].Value.ToString();
                        string ProductID    = dgvProductDetails.Rows[i].Cells["ProductID"].Value.ToString();
                        string QTY          = dgvProductDetails.Rows[i].Cells["BillQTY"].Value.ToString();
                        string Rate         = dgvProductDetails.Rows[i].Cells["Rate"].Value.ToString();
                        string ColorID      = dgvProductDetails.Rows[i].Cells["ColorID"].Value.ToString();
                        string SizeID       = dgvProductDetails.Rows[i].Cells["SizeID"].Value.ToString();
                        string BarcodeNo    = dgvProductDetails.Rows[i].Cells["BarcodeNo"].Value.ToString();
                        string SubProductID = dgvProductDetails.Rows[i].Cells["SubProductID"].Value.ToString();

                        ObjDAL.SetColumnData("StoreBillDetailsID", SqlDbType.Int, TransferID);

                        ObjDAL.SetColumnData("ProductID", SqlDbType.Int, ProductID);
                        ObjDAL.SetColumnData("Barcode", SqlDbType.NVarChar, BarcodeNo);
                        ObjDAL.SetColumnData("SubProductID", SqlDbType.Int, SubProductID);
                        ObjDAL.SetColumnData("Rate", SqlDbType.Decimal, Rate);
                        ObjDAL.SetColumnData("BillQTY", SqlDbType.Int, QTY);
                        ObjDAL.SetColumnData("ColorID", SqlDbType.Int, ColorID);
                        ObjDAL.SetColumnData("SizeID", SqlDbType.Int, SizeID);
                        ObjDAL.SetColumnData("Total", SqlDbType.Decimal, Total);
                        ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID);

                        ObjDAL.InsertData(clsUtility.DBName + ".dbo.tblStoreTransferItemDetails", false);
                    }
                    clsUtility.ShowInfoMessage("Item has been transferd to selected store.", clsUtility.strProjectTitle);
                }
            }
            else
            {
                _BillNumber = txtInvoiceNumber.Text;
                ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now);
                ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID);
                ObjDAL.UpdateData(clsUtility.DBName + ".dbo.tblStoreTransferBillDetails", "StoreTransferID='" + Bill_ID + "'");

                ObjDAL.ExecuteNonQuery("Delete " + clsUtility.DBName + ".dbo.tblStoreTransferItemDetails WHERE StoreBillDetailsID=" + Bill_ID);
                int pBillQTY = 0;
                for (int i = 0; i < dgvProductDetails.Rows.Count; i++)
                {
                    string Total     = dgvProductDetails.Rows[i].Cells["Total"].Value.ToString();
                    string ProductID = dgvProductDetails.Rows[i].Cells["ProductID"].Value.ToString();

                    string QTY = dgvProductDetails.Rows[i].Cells["BillQTY"].Value.ToString();
                    pBillQTY += Convert.ToInt32(QTY);

                    string Rate         = dgvProductDetails.Rows[i].Cells["Rate"].Value.ToString();
                    string ColorID      = dgvProductDetails.Rows[i].Cells["ColorID"].Value.ToString();
                    string SizeID       = dgvProductDetails.Rows[i].Cells["SizeID"].Value.ToString();
                    string BarcodeNo    = dgvProductDetails.Rows[i].Cells["BarcodeNo"].Value.ToString();
                    string SubProductID = dgvProductDetails.Rows[i].Cells["SubProductID"].Value.ToString();
                    ObjDAL.SetColumnData("StoreBillDetailsID", SqlDbType.Int, Bill_ID);

                    ObjDAL.SetColumnData("ProductID", SqlDbType.Int, ProductID);
                    ObjDAL.SetColumnData("Barcode", SqlDbType.NVarChar, BarcodeNo);
                    ObjDAL.SetColumnData("SubProductID", SqlDbType.Int, SubProductID);
                    ObjDAL.SetColumnData("Rate", SqlDbType.Decimal, Rate);
                    ObjDAL.SetColumnData("BillQTY", SqlDbType.Int, QTY);
                    ObjDAL.SetColumnData("ColorID", SqlDbType.Int, ColorID);
                    ObjDAL.SetColumnData("SizeID", SqlDbType.Int, SizeID);
                    ObjDAL.SetColumnData("Total", SqlDbType.Decimal, Total);
                    ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID);

                    ObjDAL.InsertData(clsUtility.DBName + ".dbo.tblStoreTransferItemDetails", false);
                }
                ObjDAL.UpdateColumnData("TotalQTY", SqlDbType.Int, pBillQTY);
                ObjDAL.UpdateColumnData("UpdatedOn", SqlDbType.DateTime, DateTime.Now);
                ObjDAL.UpdateColumnData("UpdatedBy", SqlDbType.Int, clsUtility.LoginID);
                ObjDAL.UpdateData(clsUtility.DBName + ".dbo.tblStoreTransferBillDetails", "StoreTransferID='" + Bill_ID + "'");

                clsUtility.ShowInfoMessage("Item has been transferd to selected store.", clsUtility.strProjectTitle);
            }

            return(_BillNumber);
        }