private void SaveEmployee() { ObjDAL.SetStoreProcedureData("EmployeeCode", SqlDbType.NVarChar, txtEmployeeCode.Text.Trim(), clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("Name", SqlDbType.NVarChar, txtName.Text.Trim(), clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("MobileNo", SqlDbType.VarChar, txtMobileNo.Text, clsConnection_DAL.ParamType.Input); if (radMale.Checked) { ObjDAL.SetStoreProcedureData("Gender", SqlDbType.Bit, true, clsConnection_DAL.ParamType.Input); } else if (radFemale.Checked) { ObjDAL.SetStoreProcedureData("Gender", SqlDbType.Bit, false, clsConnection_DAL.ParamType.Input); } if (dtpDOB.Checked) { ObjDAL.SetStoreProcedureData("DOB", SqlDbType.DateTime, dtpDOB.Value.ToString("yyyy-MM-dd"), clsConnection_DAL.ParamType.Input); } else { ObjDAL.SetStoreProcedureData("DOB", SqlDbType.DateTime, null, clsConnection_DAL.ParamType.Input); } ObjDAL.SetStoreProcedureData("Address", SqlDbType.NVarChar, txtAdd.Text.Trim(), clsConnection_DAL.ParamType.Input); if (PicEmployee.Image != null) { ObjDAL.SetStoreProcedureData("Photo", SqlDbType.VarBinary, ObjUtil.GetImageBytes(PicEmployee.Image), clsConnection_DAL.ParamType.Input); } ObjDAL.SetStoreProcedureData("CreatedBy", SqlDbType.Int, clsUtility.LoginID, clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("EMPID", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Output); bool b = ObjDAL.ExecuteStoreProcedure_DML(clsUtility.DBName + ".dbo.SPR_Insert_Employee"); if (b) { DataTable dt = ObjDAL.GetOutputParmData(); if (ObjUtil.ValidateTable(dt)) { EmployeeID = Convert.ToInt32(dt.Rows[0][1]); } ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave); clsUtility.ShowInfoMessage("Employee has been added Successfully.", clsUtility.strProjectTitle); if (txtUsername.Text.Trim().Length != 0 && txtPass.Text.Trim().Length != 0) { CreateNewUser(EmployeeID); } ClearAll(); LoadData(); grpEmployee.Enabled = false; } else { clsUtility.ShowInfoMessage("Failed to add the Employee.", clsUtility.strProjectTitle); ObjDAL.ResetData(); } }
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); } }
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(); } }
private void btnSaveData_Click(object sender, EventArgs e) { if (ValidateEnterQTY()) { bool b = false; for (int i = 0; i < dtStoreTransfer.Rows.Count; i++) { ObjDAL.SetStoreProcedureData("TransferItemID", SqlDbType.Int, dtStoreTransfer.Rows[i]["TransferItemID"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("StoreBillDetailsID", SqlDbType.Int, dtStoreTransfer.Rows[i]["StoreBillDetailsID"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("ProductID", SqlDbType.Int, dtStoreTransfer.Rows[i]["ProductID"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("SubProductID", SqlDbType.Int, dtStoreTransfer.Rows[i]["SubProductID"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("ModelNo", SqlDbType.NVarChar, dtStoreTransfer.Rows[i]["StyleNo"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("Barcode", SqlDbType.NVarChar, dtStoreTransfer.Rows[i]["Barcode"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("BillQTY", SqlDbType.Int, dtStoreTransfer.Rows[i]["BillQTY"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("EnterQTY", SqlDbType.Int, dtStoreTransfer.Rows[i]["EnterQTY"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("ColorID", SqlDbType.Int, dtStoreTransfer.Rows[i]["ColorID"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("SizeID", SqlDbType.Int, dtStoreTransfer.Rows[i]["SizeID"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("Total", SqlDbType.Decimal, dtStoreTransfer.Rows[i]["Total"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("CellColor", SqlDbType.VarChar, dtStoreTransfer.Rows[i]["CellColor"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("CreatedBy", SqlDbType.Int, clsUtility.LoginID, clsConnection_DAL.ParamType.Input); b = ObjDAL.ExecuteStoreProcedure_DML(clsUtility.DBName + ".dbo.SPR_Insert_StoreTransferItemDetails_Voilet"); } if (b) { clsUtility.ShowInfoMessage("Entered QTY details Updated.", clsUtility.strProjectTitle); this.Close(); } else { clsUtility.ShowInfoMessage("Entered QTY details is not Updated.", clsUtility.strProjectTitle); } } else { clsUtility.ShowInfoMessage("Scan transfer Items.", clsUtility.strProjectTitle); } }
private void InsertPettyCashExpenses() { bool b = false; if (ObjUtil.ValidateTable(dtExpenses)) { for (int i = 0; i < dtExpenses.Rows.Count; i++) { ObjDAL.SetStoreProcedureData("PettyCashExpAmt", SqlDbType.Decimal, dtExpenses.Rows[i]["ExpensesAmt"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("Particulars", SqlDbType.NVarChar, dtExpenses.Rows[i]["Particulars"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("MasterCashClosingID", SqlDbType.Int, dtExpenses.Rows[i]["MasterCashClosingID"], clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("CreatedBy", SqlDbType.Int, clsUtility.LoginID, clsConnection_DAL.ParamType.Input); b = ObjDAL.ExecuteStoreProcedure_DML(clsUtility.DBName + ".[dbo].SPR_Insert_PettyCashExpAmt"); } if (b) { clsUtility.ShowInfoMessage("Petty Cash Book has been Saved !", clsUtility.strProjectTitle); } ObjDAL.ResetData(); } }
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, cmbListBox.Text); //ObjDAL.SetColumnData("ModelNo", SqlDbType.NVarChar, listBoxStyleNo.SelectedItem); ObjDAL.SetColumnData("ProductID", SqlDbType.Int, ProductID); ObjDAL.SetColumnData("SubProductID", SqlDbType.Int, SubProductID); 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); if (DeliveryPurchaseBillID2 > 0 && DeliveryPurchaseBillID3 > 0) { ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave); clsUtility.ShowInfoMessage(clsUtility.MsgDataSaved, clsUtility.strProjectTitle); } else { ObjDAL.SetStoreProcedureData("PurchaseInvoiceID", SqlDbType.Int, pPurchaseInvoiceID, clsConnection_DAL.ParamType.Input); ObjDAL.ExecuteStoreProcedure_DML(clsUtility.DBName + ".dbo.SPR_Delete_Delivering_PurchaseBill"); clsUtility.ShowInfoMessage(clsUtility.MsgDatanotSaved, clsUtility.strProjectTitle); } LoadData(); // Added LoadModelData(); Clear_ColorSize(); txtSupplierBillNo.Enabled = false; btnSearch.Enabled = false; object qty = dtPurchaseInvoice.Compute("SUM(QTY)", null); txtTotalQTY.Text = qty.ToString(); //grpPurchaseBillDetail.Enabled = false; } else { clsUtility.ShowInfoMessage(clsUtility.MsgDatanotSaved, clsUtility.strProjectTitle); } ObjDAL.ResetData(); } else { clsUtility.ShowErrorMessage("Purchase Invoice '" + txtSupplierBillNo.Text + "' is already exist..", clsUtility.strProjectTitle); txtSupplierBillNo.Focus(); } } } else { clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle); } }