示例#1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (ValidateForm())
     {
         int a = 0;
         for (int i = 0; i < dtSize.Rows.Count; i++)
         {
             ObjDAL.SetColumnData("Size", SqlDbType.VarChar, dtSize.Rows[i]["Size"].ToString());
             ObjDAL.SetColumnData("ActiveStatus", SqlDbType.Bit, Convert.ToInt32(dtSize.Rows[i]["ActiveStatus"]));
             ObjDAL.SetColumnData("SizeTypeID", SqlDbType.Int, Convert.ToInt32(dtSize.Rows[i]["SizeTypeID"]));
             ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
             a = ObjDAL.InsertData(clsUtility.DBName + ".dbo.SizeMaster", true);
         }
         if (a > 0)
         {
             //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
             ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
             clsUtility.ShowInfoMessage(clsUtility.MsgDataSaved, clsUtility.strProjectTitle);
             ClearAll();
             LoadData();
             grpSizeType.Enabled = false;
             btnAddMore.Enabled  = false;
         }
         else
         {
             clsUtility.ShowInfoMessage(clsUtility.MsgDatanotSaved, clsUtility.strProjectTitle);
             ObjDAL.ResetData();
         }
     }
 }
示例#2
0
        private void GetSelectedItemStockDetails()
        {
            ObjDAL.SetStoreProcedureData("ProductID", SqlDbType.Int, dgvBranchStockDetails.SelectedRows[0].Cells["ProductID"].Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("BarcodeNo", SqlDbType.BigInt, dgvBranchStockDetails.SelectedRows[0].Cells["BarcodeNo"].Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ColorID", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ModelNo", SqlDbType.NVarChar, dgvBranchStockDetails.SelectedRows[0].Cells["ModelNo"].Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("CategoryID", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_Material_NewDetails");

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (ObjUtil.ValidateTable(dt))
                {
                    if (dt.Rows.Count > 1)
                    {
                        dgvStockDetails.DataSource = dt;
                    }
                    else
                    {
                        dgvStockDetails.DataSource = null;
                    }
                }
                else
                {
                    dgvStockDetails.DataSource = null;
                }
            }
            ObjDAL.ResetData();
        }
示例#3
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (ValidateForm())
     {
         if (DuplicateUser(0))
         {
             ObjDAL.SetColumnData("Name", SqlDbType.NVarChar, txtCustomerName.Text.Trim());
             ObjDAL.SetColumnData("Address", SqlDbType.NVarChar, txtCustomerAddress.Text.Trim());
             ObjDAL.SetColumnData("PhoneNo", SqlDbType.NVarChar, txtCustomerPhoneNo.Text.Trim());
             ObjDAL.SetColumnData("ActiveStatus", SqlDbType.Bit, cmbCustomerActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
             ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
             if (ObjDAL.InsertData(clsUtility.DBName + ".dbo.CustomerMaster", true) > 0)
             {
                 //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
                 ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
                 clsUtility.ShowInfoMessage("Customer Name : '" + txtCustomerName.Text + "' is Saved Successfully..", clsUtility.strProjectTitle);
                 ClearAll();
                 LoadData();
                 grpCustomer.Enabled = false;
             }
             else
             {
                 clsUtility.ShowInfoMessage("Customer Name : '" + txtCustomerName.Text + "' is not Saved Successfully..", clsUtility.strProjectTitle);
             }
         }
         else
         {
             clsUtility.ShowErrorMessage("'" + txtCustomerName.Text + "' Customer is already exist..", clsUtility.strProjectTitle);
             txtCustomerName.Focus();
         }
         ObjDAL.ResetData();
     }
 }
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (Validateform())
     {
         if (DuplicateUser(0))
         {
             ObjDAL.SetColumnData("CountryID", SqlDbType.Int, cmbCountry.SelectedValue);
             ObjDAL.SetColumnData("CurrencyCode", SqlDbType.NVarChar, txtCurrencyCode.Text);
             ObjDAL.SetColumnData("CurrencyName", SqlDbType.NVarChar, txtCurrencyName.Text);
             ObjDAL.SetColumnData("CurrencyRate", SqlDbType.Decimal, txtCurrencyRate.Text);
             ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
             if (ObjDAL.InsertData(clsUtility.DBName + ".dbo.CurrencyRateSetting", true) > 0)
             {
                 ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
                 clsUtility.ShowInfoMessage("Currency Rate for '" + cmbCountry.Text + "' is Saved Successfully..", clsUtility.strProjectTitle);
                 ClearAll();
                 LoadData();
                 grpCurrencyValue.Enabled = false;
             }
             else
             {
                 clsUtility.ShowInfoMessage("Currency Rate for '" + cmbCountry.Text + "' is not Saved Successfully..", clsUtility.strProjectTitle);
             }
         }
         else
         {
             clsUtility.ShowErrorMessage("Currency Rate for '" + cmbCountry.Text + "' is already exist..", clsUtility.strProjectTitle);
             cmbCountry.Focus();
         }
         ObjDAL.ResetData();
     }
 }
        private void SearchByStyleNo()
        {
            ObjDAL.SetStoreProcedureData("PurchaseInvoiceID", SqlDbType.Int, txtPurchaseID.Text, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ModelNo", SqlDbType.NVarChar, cmbListBox.Text, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("PrintStaus", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.Get_PurchaseInvoice_BulkPrint_Color_Size");

            if (ObjUtil.ValidateDataSet(ds))
            {
                DataTable dtPurchaseInvDetails = ds.Tables[0];
                if (ObjUtil.ValidateTable(dtPurchaseInvDetails))
                {
                    dataGridView1.DataSource = dtPurchaseInvDetails;
                    //txtPurchaseID.Text = "";
                }
                else
                {
                    dataGridView1.DataSource = dtPurchaseInvDetails;
                    //txtPurchaseID.Clear();
                    clsUtility.ShowInfoMessage("No purchase invoice found for the given purhcase number.");
                }
            }
            ObjDAL.ResetData();
        }
示例#6
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (Validateform())
     {
         if (DuplicateUser(0))
         {
             ObjDAL.SetColumnData("SizeTypeName", SqlDbType.NVarChar, txtSizeTypeName.Text.Trim());
             //if (cmbDepartment.SelectedIndex >= 0)
             //{
             ObjDAL.SetColumnData("CategoryID", SqlDbType.Int, cmbDepartment.SelectedValue);
             //}
             ObjDAL.SetColumnData("ActiveStatus", SqlDbType.Bit, cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
             ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
             if (ObjDAL.InsertData(clsUtility.DBName + ".dbo.SizeTypeMaster", true) > 0)
             {
                 //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
                 ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
                 clsUtility.ShowInfoMessage("Size Type Name : '" + txtSizeTypeName.Text + "' is Saved Successfully..", clsUtility.strProjectTitle);
                 ClearAll();
                 LoadData();
                 grpSizeTypeDetails.Enabled = false;
             }
             else
             {
                 clsUtility.ShowInfoMessage("Size Type Name : '" + txtSizeTypeName.Text + "' is not Saved Successfully..", clsUtility.strProjectTitle);
             }
             ObjDAL.ResetData();
         }
         else
         {
             clsUtility.ShowErrorMessage("'" + txtSizeTypeName.Text + "' Size Type is already exist..", clsUtility.strProjectTitle);
             txtSizeTypeName.Focus();
         }
     }
 }
示例#7
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (clsFormRights.HasFormRight(clsFormRights.Forms.Purchase_Invoice, clsFormRights.Operation.Save) || clsUtility.IsAdmin)
            {
                if (Validateform())
                {
                    if (DuplicateUser(0))
                    {
                        ObjDAL.SetColumnData("SupplierBillNo", SqlDbType.NVarChar, txtSupplierBillNo.Text.Trim());
                        ObjDAL.SetColumnData("ShipmentNo", SqlDbType.NVarChar, txtShipmentNo.Text.Trim());
                        ObjDAL.SetColumnData("BillValue", SqlDbType.Decimal, txtBillValue.Text.Trim());
                        ObjDAL.SetColumnData("TotalQTY", SqlDbType.Int, txtTotalQTY.Text.Trim());
                        ObjDAL.SetColumnData("SupplierID", SqlDbType.Int, cmbSupplier.SelectedValue);
                        ObjDAL.SetColumnData("BillDate", SqlDbType.Date, dtpBillDate.Value.ToString("yyyy-MM-dd"));
                        ObjDAL.SetColumnData("Discount", SqlDbType.Decimal, txtForeignDiscount.Text.Length > 0 ? Convert.ToDecimal(txtForeignDiscount.Text) : 0);
                        ObjDAL.SetColumnData("ForeignExp", SqlDbType.Decimal, txtForeignExp.Text.Length > 0 ? Convert.ToDecimal(txtForeignExp.Text) : 0);
                        ObjDAL.SetColumnData("GrandTotal", SqlDbType.Decimal, txtNetValue.Text.Trim());

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

                        ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
                        if (ObjDAL.InsertData(clsUtility.DBName + ".dbo.PurchaseInvoice", true) > 0)
                        {
                            //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
                            ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
                            clsUtility.ShowInfoMessage("Purchase Invoice for '" + cmbSupplier.Text + "' is Saved Successfully..", clsUtility.strProjectTitle);
                            ClearAll();
                            LoadData();
                            grpPurchaseInvoice.Enabled = false;
                            grpForeignCurrency.Enabled = false;
                            grpLocalCurrency.Enabled   = false;
                        }
                        else
                        {
                            clsUtility.ShowInfoMessage("Purchase Invoice for '" + cmbSupplier.Text + "' is not Saved Successfully..", 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);
            }
        }
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (clsFormRights.HasFormRight(clsFormRights.Forms.Delivering_Purchase_Bill, clsFormRights.Operation.Save) || clsUtility.IsAdmin)
     {
         if (Validateform())
         {
             if (DuplicateUser(0))
             {
                 int DeliveryPurchaseBillID = 0;
                 ObjDAL.SetColumnData("PurchaseInvoiceID", SqlDbType.Int, pPurchaseInvoiceID);
                 ObjDAL.SetColumnData("SupplierBillNo", SqlDbType.NVarChar, txtSupplierBillNo.Text.Trim());
                 ObjDAL.SetColumnData("SizeTypeID", SqlDbType.Int, cmbSizeType.SelectedValue);
                 ObjDAL.SetColumnData("ModelNo", SqlDbType.NVarChar, listBoxModelNo.SelectedItem);
                 ObjDAL.SetColumnData("ProductID", SqlDbType.Int, ProductID);
                 ObjDAL.SetColumnData("StoreID", SqlDbType.Int, cmbStore.SelectedValue);
                 ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
                 DeliveryPurchaseBillID = ObjDAL.InsertData(clsUtility.DBName + ".dbo.DeliveryPurchaseBill1", true);
                 if (DeliveryPurchaseBillID > 0)
                 {
                     int DeliveryPurchaseBillID2 = DataSavedDeliveryPurchaseBill2(DeliveryPurchaseBillID);
                     int DeliveryPurchaseBillID3 = DataSavedDeliveryPurchaseBill3(DeliveryPurchaseBillID, DeliveryPurchaseBillID2);
                     //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
                     ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
                     clsUtility.ShowInfoMessage(clsUtility.MsgDataSaved, clsUtility.strProjectTitle);
                     Clear_ColorSize();
                     //LoadData();
                     LoadModelData();
                     txtSupplierBillNo.Enabled = false;
                     btnSearch.Enabled         = false;
                     //grpPurchaseBillDetail.Enabled = false;
                 }
                 else
                 {
                     clsUtility.ShowInfoMessage(clsUtility.MsgDatanotSaved, clsUtility.strProjectTitle);
                     ObjDAL.ResetData();
                 }
             }
             else
             {
                 clsUtility.ShowErrorMessage("Purchase Invoice '" + txtSupplierBillNo.Text + "' is already exist..", clsUtility.strProjectTitle);
                 ObjDAL.ResetData();
                 txtSupplierBillNo.Focus();
             }
         }
     }
     else
     {
         clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
     }
 }
示例#9
0
 private void btnSaveData_Click(object sender, EventArgs e)
 {
     if (StoreBillDetailsID > 0)
     {
         ObjDAL.SetStoreProcedureData("ReceiveBillNo", SqlDbType.NVarChar, GenerateReceiveBillNumber(), clsConnection_DAL.ParamType.Input);
         ObjDAL.SetStoreProcedureData("StoreBillDetailsID", SqlDbType.Int, StoreBillDetailsID, clsConnection_DAL.ParamType.Input);
         ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input);
         ObjDAL.SetStoreProcedureData("CreatedBy", SqlDbType.Int, clsUtility.LoginID, clsConnection_DAL.ParamType.Input);
         DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Insert_ReceiveBillDetails");
         if (ds != null && ds.Tables.Count > 0)
         {
             DataTable dt = ds.Tables[0];
             if (ObjUtil.ValidateTable(dt))
             {
                 if (Convert.ToInt32(dt.Rows[0]["Flag"]) == 1)
                 {
                     StoreBillDetailsID = 0;
                     LoadData();
                 }
                 clsUtility.ShowInfoMessage(dt.Rows[0]["Msg"].ToString(), clsUtility.strProjectTitle);
             }
         }
     }
     else
     {
         clsUtility.ShowInfoMessage("There is no Update found for Receive Bill details.", clsUtility.strProjectTitle);
     }
     ObjDAL.ResetData();
 }
示例#10
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (clsFormRights.HasFormRight(clsFormRights.Forms.frmOtherSetting, clsFormRights.Operation.Delete) || clsUtility.IsAdmin)
     {
         DialogResult d = MessageBox.Show("Are you sure want to delete '" + cmbSelectPC.Text + "' Machine ", clsUtility.strProjectTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (d == DialogResult.Yes)
         {
             if (ObjDAL.DeleteData(clsUtility.DBName + ".dbo.tblPC_Store_Mapping", "PC_Store_ID = " + ID) > 0)
             {
                 clsUtility.ShowInfoMessage("'" + cmbSelectPC.Text + "' Machine has been deleted  ", clsUtility.strProjectTitle);
                 ClearAll();
                 LoadData();
                 groupBox1.Enabled = false;
                 ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterDelete);
             }
             else
             {
                 clsUtility.ShowErrorMessage("'" + cmbSelectPC.Text + "' Machine is not deleted  ", clsUtility.strProjectTitle);
                 ObjDAL.ResetData();
             }
         }
     }
     else
     {
         clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
     }
 }
示例#11
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();
                }
            }
        }
示例#12
0
 private void InsertComapnyMasterTable()
 {
     ObjDAL.SetColumnData("CompanyName", SqlDbType.NVarChar, txtOrganisation.Text.Trim());
     ObjDAL.SetColumnData("Address", SqlDbType.NVarChar, txtAddress.Text.Trim());
     ObjDAL.SetColumnData("MobileNo", SqlDbType.NVarChar, txtMobileNo.Text.Trim());
     ObjDAL.SetColumnData("EmailID", SqlDbType.NVarChar, txtEmail.Text.Trim());
     ObjDAL.InsertData(clsUtility.DBName + ".dbo.CompanyMaster", false);
     ObjDAL.ResetData();
 }
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (clsFormRights.HasFormRight(clsFormRights.Forms.Supplier_Details, clsFormRights.Operation.Save) || clsUtility.IsAdmin)
     {
         if (Validateform())
         {
             if (DuplicateUser(0))
             {
                 ObjDAL.SetColumnData("SupplierName", SqlDbType.NVarChar, txtSupplierName.Text.Trim());
                 ObjDAL.SetColumnData("CountryID", SqlDbType.Int, cmbCountry.SelectedValue);
                 ObjDAL.SetColumnData("Phone", SqlDbType.VarChar, txtPhone.Text.Trim());
                 ObjDAL.SetColumnData("EmailID", SqlDbType.VarChar, txtEmail.Text.Trim());
                 ObjDAL.SetColumnData("BankName", SqlDbType.NVarChar, txtBankName.Text.Trim());
                 ObjDAL.SetColumnData("BankAccountNo", SqlDbType.VarChar, txtBankAccNo.Text.Trim());
                 ObjDAL.SetColumnData("BankAddress", SqlDbType.NVarChar, txtBankAdd.Text.Trim());
                 ObjDAL.SetColumnData("ActiveStatus", SqlDbType.Bit, cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
                 ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
                 if (ObjDAL.InsertData(clsUtility.DBName + ".dbo.SupplierMaster", true) > 0)
                 {
                     ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
                     clsUtility.ShowInfoMessage("Supplier Name : '" + txtSupplierName.Text + "' is Saved Successfully..", clsUtility.strProjectTitle);
                     ClearAll();
                     LoadData();
                     grpSupplier.Enabled = false;
                 }
                 else
                 {
                     clsUtility.ShowInfoMessage("Supplier : '" + txtSupplierName.Text + "' is not Saved Successfully..", 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);
     }
 }
示例#14
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (clsFormRights.HasFormRight(clsFormRights.Forms.Store_Master, clsFormRights.Operation.Save) || clsUtility.IsAdmin)
            {
                if (Validateform())
                {
                    if (DuplicateUser(0))
                    {
                        ObjDAL.SetColumnData("StoreName", SqlDbType.NVarChar, txtStoreName.Text.Trim());
                        ObjDAL.SetColumnData("Tel", SqlDbType.VarChar, txtTel.Text.Trim());
                        ObjDAL.SetColumnData("Fax", SqlDbType.VarChar, txtFax.Text.Trim());
                        ObjDAL.SetColumnData("Place", SqlDbType.NVarChar, txtPlace.Text.Trim());
                        ObjDAL.SetColumnData("StoreCategory", SqlDbType.Int, cmbStoreCat.SelectedIndex);
                        ObjDAL.SetColumnData("ActiveStatus", SqlDbType.Bit, cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
                        ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
                        if (ObjDAL.InsertData(clsUtility.DBName + ".dbo.StoreMaster", true) > 0)
                        {
                            //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
                            ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);

                            clsUtility.ShowInfoMessage("Store : '" + txtStoreName.Text + "' is Saved Successfully..", clsUtility.strProjectTitle);
                            ClearAll();
                            LoadData();
                            grpStore.Enabled = false;
                        }
                        else
                        {
                            clsUtility.ShowInfoMessage("Store : '" + txtStoreName.Text + "' is not Saved Successfully..", clsUtility.strProjectTitle);
                        }
                    }
                    else
                    {
                        clsUtility.ShowErrorMessage("Store : '" + txtStoreName.Text + "' is already exist..", clsUtility.strProjectTitle);
                        txtStoreName.Focus();
                    }
                    ObjDAL.ResetData();
                }
            }
            else
            {
                clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
            }
        }
示例#15
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (clsFormRights.HasFormRight(clsFormRights.Forms.Customer_Master, clsFormRights.Operation.Save) || clsUtility.IsAdmin)
            {
                if (ValidateForm())
                {
                    if (DuplicateUser(0))
                    {
                        ObjDAL.SetStoreProcedureData("Name", SqlDbType.NVarChar, txtCustomerName.Text.Trim(), clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("Address", SqlDbType.NVarChar, txtCustomerAddress.Text.Trim(), clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("PhoneNo", SqlDbType.NVarChar, txtCustomerMobileNo.Text.Trim(), clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("EmailID", SqlDbType.NVarChar, txtCustomerEmailID.Text.Trim(), clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("ActiveStatus", SqlDbType.Bit, cmbCustomerActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0, clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("CreatedBy", SqlDbType.Int, clsUtility.LoginID, clsConnection_DAL.ParamType.Input);

                        bool b = ObjDAL.ExecuteStoreProcedure_DML(clsUtility.DBName + ".dbo.SPR_Insert_Customer");
                        if (b)
                        {
                            //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
                            ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
                            clsUtility.ShowInfoMessage("Customer Name : '" + txtCustomerName.Text + "' is Saved Successfully..", clsUtility.strProjectTitle);
                            ClearAll();
                            LoadData();
                            grpCustomer.Enabled = false;
                        }
                        else
                        {
                            clsUtility.ShowInfoMessage("Customer Name : '" + txtCustomerName.Text + "' is not Saved Successfully..", clsUtility.strProjectTitle);
                        }
                    }
                    else
                    {
                        clsUtility.ShowErrorMessage("'" + txtCustomerName.Text + "' Customer is already exist..", clsUtility.strProjectTitle);
                        txtCustomerName.Focus();
                    }
                    ObjDAL.ResetData();
                }
            }
            else
            {
                clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
            }
        }
示例#16
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (clsFormRights.HasFormRight(clsFormRights.Forms.Brand_Master, clsFormRights.Operation.Save) || clsUtility.IsAdmin)
     {
         if (Validateform())
         {
             if (DuplicateUser(0))
             {
                 ObjDAL.SetColumnData("CashBand", SqlDbType.Decimal, txtCashBand.Text.Trim());
                 ObjDAL.SetColumnData("ActiveStatus", SqlDbType.Bit, cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
                 ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
                 if (ObjDAL.InsertData(clsUtility.DBName + ".dbo.tblCloseCashBandMaster", true) > 0)
                 {
                     //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
                     ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
                     clsUtility.ShowInfoMessage("CashBand : '" + txtCashBand.Text + "' is Saved Successfully..", clsUtility.strProjectTitle);
                     ClearAll();
                     LoadData();
                     grpClosingBALMaster.Enabled = false;
                 }
                 else
                 {
                     clsUtility.ShowInfoMessage("CashBand Name : '" + txtCashBand.Text + "' is not Saved Successfully..", clsUtility.strProjectTitle);
                     ObjDAL.ResetData();
                 }
             }
             else
             {
                 clsUtility.ShowErrorMessage("'" + txtCashBand.Text + "' CashBand is already exist..", clsUtility.strProjectTitle);
                 ObjDAL.ResetData();
                 txtCashBand.Focus();
             }
         }
     }
     else
     {
         clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
     }
 }
示例#17
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (Validateform())
     {
         ObjDAL.SetStoreProcedureData("PettyCashAmt", SqlDbType.Decimal, txtPettyCash.Text, clsConnection_DAL.ParamType.Input);
         ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input);
         ObjDAL.SetStoreProcedureData("CreatedBy", SqlDbType.Int, clsUtility.LoginID, clsConnection_DAL.ParamType.Input);
         bool b = ObjDAL.ExecuteStoreProcedure_DML(clsUtility.DBName + ".dbo.SPR_Insert_PettyCashAmt");
         if (b)
         {
             clsUtility.ShowInfoMessage("Petty Cash book Saved Successfully..", clsUtility.strProjectTitle);
             ClearAll();
             LoadData();
         }
         else
         {
             clsUtility.ShowInfoMessage("Petty Cash book not Saved Successfully..", clsUtility.strProjectTitle);
         }
         ObjDAL.ResetData();
     }
 }
示例#18
0
        private void LoadData()
        {
            ObjDAL.SetStoreProcedureData("ColorName", SqlDbType.NVarChar, 0, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_Color_Master");

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (ObjUtil.ValidateTable(dt))
                {
                    dgvColorMaster.DataSource = dt;
                }
                else
                {
                    dgvColorMaster.DataSource = null;
                }
            }
            else
            {
                dgvColorMaster.DataSource = null;
            }
            ObjDAL.ResetData();
        }
示例#19
0
        private void InsertClientRegistration()
        {
            //clsConnection_DAL ObjDAL = new clsConnection_DAL(true);
            DataTable dt = ObjDAL.GetDataCol(ClientDBName + ".dbo.RegistrationDetails", "[SoftKey],[ExpiryDate],[StatusDate]", "ISNULL([IsServer],0) = 1 AND ISNULL([IsKeyEnter],0) = 1", null);

            if (ObjUtil.ValidateTable(dt))
            {
                ObjDAL.SetColumnData("PcName", SqlDbType.NVarChar, Environment.MachineName);
                ObjDAL.SetColumnData("StatusDate", SqlDbType.VarChar, dt.Rows[0]["StatusDate"].ToString());
                ObjDAL.SetColumnData("SoftKey", SqlDbType.VarChar, dt.Rows[0]["SoftKey"].ToString());
                ObjDAL.SetColumnData("IsTrail", SqlDbType.Bit, 0);
                ObjDAL.SetColumnData("RegDate", SqlDbType.Date, DateTime.Now);
                ObjDAL.SetColumnData("ExpiryDate", SqlDbType.VarChar, dt.Rows[0]["ExpiryDate"].ToString());
                ObjDAL.SetColumnData("IsKeyEnter", SqlDbType.Bit, 1);

                if (ObjDAL.InsertData(ClientDBName + ".dbo.RegistrationDetails", true) > 0)
                {
                    ObjDAL.ResetData();
                    clsUtility.ShowInfoMessage("Client Registration is successfully", clsUtility.strProjectTitle);
                    //System.Diagnostics.Process.Start(exeName + ".exe");
                    Application.Exit();
                }
            }
        }
示例#20
0
        private void CreateNewUser(int EmployeeID)
        {
            ObjDAL.SetColumnData("UserName", SqlDbType.NVarChar, txtUsername.Text.Trim());
            ObjDAL.SetColumnData("Password", SqlDbType.NVarChar, ObjUtil.Encrypt(txtPass.Text.Trim(), true));
            ObjDAL.SetColumnData("EmailID", SqlDbType.NVarChar, txtEmail.Text.Trim());
            ObjDAL.SetColumnData("IsAdmin", SqlDbType.Bit, false);
            ObjDAL.SetColumnData("IsBlock", SqlDbType.Bit, false);
            ObjDAL.SetColumnData("EmployeeID", SqlDbType.Int, EmployeeID);

            if (ObjDAL.InsertData(clsUtility.DBName + ".dbo.UserManagement", true) > 0)
            {
                ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
                clsUtility.ShowInfoMessage("User has been added Successfully.", clsUtility.strProjectTitle);
                ClearAll();
                LoadData();
                grpEmployee.Enabled = false;
            }
            else
            {
                clsUtility.ShowInfoMessage("Failed to add the User.", clsUtility.strProjectTitle);
                ObjDAL.ResetData();
            }
        }
        private void SearchByProductID()
        {
            //DataTable dt = ObjDAL.ExecuteSelectStatement("EXEC " + clsUtility.DBName + ".dbo.Get_Material_Details " + txtProductID.Text + ",NULL");

            ObjDAL.SetStoreProcedureData("ProductID", SqlDbType.Int, txtProductID.Text.Trim(), clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, DBNull.Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("BarcodeNo", SqlDbType.BigInt, DBNull.Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ColorID", SqlDbType.Int, DBNull.Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ModelNo", SqlDbType.NVarChar, DBNull.Value, clsConnection_DAL.ParamType.Input);
            DataSet   ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.Get_Material_Details");
            DataTable dt = ds.Tables[0];

            if (ObjUtil.ValidateTable(dt))
            {
                dgvProductDetails.DataSource = dt;
            }
            else
            {
                dgvProductDetails.DataSource = null;
            }
            ObjDAL.ResetData();
        }
示例#22
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (Validateform())
     {
         if (DuplicateUser(0))
         {
             ObjDAL.SetColumnData("ProductName", SqlDbType.NVarChar, txtProductName.Text.Trim());
             ObjDAL.SetColumnData("CategoryID", SqlDbType.Int, cmbCategory.SelectedValue);
             ObjDAL.SetColumnData("ActiveStatus", SqlDbType.Bit, cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0);
             ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
             if (PicProductMaster.Image != null)
             {
                 ObjDAL.SetColumnData("Photo", SqlDbType.VarBinary, ObjUtil.GetImageBytes(PicProductMaster.Image));
             }
             if (ObjDAL.InsertData(clsUtility.DBName + ".dbo.ProductMaster", true) > 0)
             {
                 //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
                 ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
                 clsUtility.ShowInfoMessage("Product Name : '" + txtProductName.Text + "' is Saved Successfully..", clsUtility.strProjectTitle);
                 ClearAll();
                 LoadData();
                 grpProduct.Enabled = false;
             }
             else
             {
                 clsUtility.ShowInfoMessage("Product Name : '" + txtProductName.Text + "' is not Saved Successfully..", clsUtility.strProjectTitle);
                 ObjDAL.ResetData();
             }
         }
         else
         {
             clsUtility.ShowErrorMessage("'" + txtProductName.Text + "' Product is already exist..", clsUtility.strProjectTitle);
             ObjDAL.ResetData();
             txtProductName.Focus();
         }
     }
 }
示例#23
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;
        }
示例#24
0
        private void LoadData()
        {
            try
            {
                ObjDAL.SetStoreProcedureData("MasterCashClosingID", SqlDbType.Int, pMasterCashClosingID, clsConnection_DAL.ParamType.Input);
                ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input);
                ObjDAL.SetStoreProcedureData("PettyCashBAL", SqlDbType.Decimal, lblPettyCashBAL.Text, clsConnection_DAL.ParamType.Output);
                DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_CashClosing_Details");
                if (ds != null && ds.Tables.Count > 0)
                {
                    DataTable dt = ds.Tables[0];
                    dtCredit   = ds.Tables[1];
                    dtExpenses = ds.Tables[2];

                    DataTable dtoutput = ObjDAL.GetOutputParmData();
                    if (ObjUtil.ValidateTable(dtoutput))
                    {
                        PettyCashBAL         = Convert.ToDecimal(dtoutput.Rows[0][1]);
                        lblPettyCashBAL.Text = PettyCashBAL.ToString();
                    }

                    if (ObjUtil.ValidateTable(dt))
                    {
                        dgvCloseCash.DataSource = dt;
                        dtCash = dt;
                        if (Convert.ToInt32(dt.Rows[0]["CashStatus"]) == 0)
                        {
                            dgvCloseCash.ReadOnly = false;
                            btnOpenCash.Enabled   = false;
                            btnCloseCash.Enabled  = true;
                            btnPreview.Enabled    = false;
                            btnPrint.Enabled      = false;

                            //btnPreview.Enabled = true;
                            //btnPrint.Enabled = true;
                            dgvCloseCash.DataSource = dtCash;
                        }
                        else
                        {
                            if (DateTime.Now.ToString("yyyy-MM-dd") == Convert.ToDateTime(dt.Rows[0]["CashBoxDate"]).ToString("yyyy-MM-dd"))
                            {
                                dgvCloseCash.ReadOnly = true;
                                btnOpenCash.Enabled   = false;
                                btnCloseCash.Enabled  = false;
                                btnPreview.Enabled    = true;
                                btnPrint.Enabled      = true;
                            }
                            else
                            {
                                dgvCloseCash.ReadOnly = true;
                                btnOpenCash.Enabled   = true;
                                btnCloseCash.Enabled  = false;
                                btnPreview.Enabled    = true;
                                btnPrint.Enabled      = true;

                                //btnPreview.Enabled = false;
                                //btnPrint.Enabled = false;
                            }
                        }
                        txtCashNo.Text         = dt.Rows[0]["CashNo"].ToString();
                        txtCashierName.Text    = dt.Rows[0]["Name"].ToString();
                        cmbShop.SelectedValue  = dt.Rows[0]["StoreID"];
                        lblReturnedAmount.Text = dt.Rows[0]["CashReturn"].ToString();
                        txtTotalValue.Text     = dt.Rows[0]["TotalCashValue"].ToString();
                    }
                    else
                    {
                        dgvCloseCash.DataSource = null;
                        dtCash               = null;
                        dtExpenses           = null;
                        btnOpenCash.Enabled  = true;
                        btnCloseCash.Enabled = false;
                        btnPreview.Enabled   = false;
                        btnPrint.Enabled     = false;
                    }
                    ObjDAL.ResetData();
                }
                else
                {
                    dtCash     = null;
                    dtExpenses = null;
                    dgvCloseCash.DataSource = null;
                    //btnOpenCash.Enabled = false;
                    btnOpenCash.Enabled  = true;
                    btnCloseCash.Enabled = false;
                    btnPreview.Enabled   = false;
                    btnPrint.Enabled     = false;
                }
            }
            catch (Exception ex)
            {
                clsUtility.ShowErrorMessage(ex.ToString(), clsUtility.strProjectTitle);
            }
        }