public void LoadForm() { if (_isLoaded) { return; } try { lblSendReport.Text = String.Empty; UserTypeTableAdapter userTypeTA = new UserTypeTableAdapter(); userTypeDT = userTypeTA.GetData(); if (userTypeDT.Rows.Count > 0) { List<KeyValuePair<string, string>> userTypeDS = new List<KeyValuePair<string, string>>(); userTypeDS.Add(new KeyValuePair<string, string>("", "<<Tất cả>>")); string typeName; string typeShortName; foreach (DataRow row in userTypeDT.Rows) { typeName = row.Field<string>("TypeName"); typeShortName = row.Field<string>("TypeShortName"); userTypeDS.Add(new KeyValuePair<string, string>(typeShortName, typeName)); } cbxUserTypeSearch.DataSource = userTypeDS; cbxUserTypeSearch.DisplayMember = "Value"; cbxUserTypeSearch.ValueMember = "Key"; } CustomerTableAdapter customerTA = new CustomerTableAdapter(); if (customerDT == null) { customerDT = customerTA.GetData(); } dataGridView.DataSource = customerDT; CustomGrid(dataGridView); List<KeyValuePair<int, string>> activeList = new List<KeyValuePair<int, string>>(); activeList.Add(new KeyValuePair<int, string>(-1, "<<Tất cả>>")); activeList.Add(new KeyValuePair<int, string>(1, "Có")); activeList.Add(new KeyValuePair<int, string>(0, "Không")); cbxActive.DataSource = activeList; cbxActive.DisplayMember = "Value"; cbxActive.ValueMember = "Key"; _isLoaded = true; } catch (Exception ex) { MessageBox.Show("Có lỗi xảy ra, không thể tải dữ liệu."); Log.ErrorLog(ex.Message); } }
private void BuildingForm_Load(object sender, EventArgs e) { try { siteAdapter = new SiteTableAdapter(); customerAdapter = new CustomerTableAdapter(); buildingAdapter = new BuildingTableAdapter(); siteAdapter.Connection = cnSql; customerAdapter.Connection = cnSql; buildingAdapter.Connection = cnSql; siteDataTable = new DataSet.SiteDataTable(); customerDataTable = new DataSet.CustomerDataTable(); buildingDataTable = new DataSet.BuildingDataTable(); siteAdapter.Fill(siteDataTable); customerAdapter.Fill(customerDataTable); buildingAdapter.Fill(buildingDataTable); enableForm(false); } catch (Exception ex) { MessageBox.Show(ex.Message); } populateBuildingsList(); populateSitesList(); populateCustomersList(); }
private void MüşterileriGöster_Load(object sender, EventArgs e) { Açıklama.ToolTipIcon = ToolTipIcon.Info; Açıklama.IsBalloon = true; if (Ayarlar.tema == "Varsayılan") { this.BackColor = Color.FromArgb(37, 46, 59); } else if (Ayarlar.tema == "Kırmızı") { this.BackColor = Color.Red; } else if (Ayarlar.tema == "Mavi") { this.BackColor = Color.Blue; } else if (Ayarlar.tema == "Yeşil") { this.BackColor = Color.Green; } Açıklama.SetToolTip(txtBoxAdı, "Adı"); Açıklama.SetToolTip(txtBoxSoyadı, "Soyadı"); CustomerTableAdapter.Fill(this.Store_ManagerDataSet.Customer); raporMüşteriGöster.RefreshReport(); }
public void Tables_AddNewCustomerAndAddressTest() { SqlConnection connection = ConnectionManager.Connection; connection.Open(); Tables tables = new Tables(); BaseTableAdapter tableAdapter = new GenderTableAdapter(); tableAdapter.Connection = connection; tableAdapter.Fill(tables.GenderDataTable); tableAdapter = new ApppTprTableAdapter(); tableAdapter.Connection = connection; tableAdapter.Fill(tables.ApppDataTable); tableAdapter = new CustomerTableAdapter(); tableAdapter.Connection = connection; tableAdapter.Fill(tables.CustomerDataTable); tableAdapter = new AdminDivisionTableAdapter(); tableAdapter.Connection = connection; tableAdapter.Fill(tables.AdminDivisionDataTable); tableAdapter = new TypeStreetTableAdapter(); tableAdapter.Connection = connection; tableAdapter.Fill(tables.TypeStreetDataTable); tableAdapter = new AddressTableAdapter(); tableAdapter.Connection = connection; tableAdapter.Fill(tables.AddressDataTable); DataRow newRow = tables.CustomerDataTable.NewRow(); newRow["MedCard"] = 123; newRow["CodeCustomer"] = 321; newRow["LastName"] = "Bogodur"; newRow["FirstName"] = "Ivan"; newRow["MiddleName"] = "Bogodurovich"; newRow["Birthday"] = new DateTime(1970, 1, 1); newRow["Arch"] = false; newRow["APPPTPRID"] = tables.ApppDataTable.Rows[0]["APPPTPRID"]; newRow["GenderID"] = tables.GenderDataTable.Rows[0]["GenderID"]; tables.CustomerDataTable.Rows.Add(newRow); int newCustomerId = (int)newRow["CustomerID"]; newRow = tables.AddressDataTable.NewRow(); newRow["City"] = "Slavyansk"; newRow["AdminDivisionID"] = tables.AdminDivisionDataTable.Rows[0]["AdminDivisionID"];; newRow["NameStreet"] = "Lenina"; newRow["NumberHouse"] = "57"; newRow["NumberApartment"] = "37"; newRow["CustomerID"] = newCustomerId; tables.AddressDataTable.Rows.Add(newRow); tables.DispancerDataSet.AcceptChanges(); var ds = tables.DispancerDataSet.GetChanges(); int count = 0; if (ds != null) { count = ds.Tables.Count; } Assert.IsTrue(count == 0); }
protected void txtSearch_TextChanged(object sender, EventArgs e) { CustomerTableAdapter customerTableAdapter = new CustomerTableAdapter(); DataSet ds = customerTableAdapter.GetSearchByCustomer(txtSearch.Text, txtSearch.Text, txtSearch.Text, "ACTIVE"); if (ds.Tables[0].Rows.Count > 0) { Session["dt"] = ds.Tables[0]; PagingDataBind((DataTable)Session["dt"]); } }
void CustomerEditor_Init(object sender, EventArgs e) { EnsureChildControls(); CustomerTableAdapter adapter = new CustomerTableAdapter(); CustomersList.DataSource = adapter.GetData(); CustomersList.DataTextField = "CompanyName"; CustomersList.DataValueField = "CustomerID"; CustomersList.DataBind(); CustomersList.Items.Insert(0, ""); }
static DataModel() { // Create the data model and the table adapters. DataModel.dataSet = new DataSet(); DataModel.customerTableAdapter = new CustomerTableAdapter(); DataModel.licenseTableAdapter = new LicenseTableAdapter(); DataModel.productTableAdapter = new ProductTableAdapter(); // Load in the data from the SQL Server. DataModel.productTableAdapter.Fill(DataModel.dataSet.Product); DataModel.customerTableAdapter.Fill(DataModel.dataSet.Customer); DataModel.licenseTableAdapter.Fill(DataModel.dataSet.License); }
void CustomerEditor_Init(object sender, EventArgs e) { EnsureChildControls(); CustomerTableAdapter adapter = new CustomerTableAdapter(); CustomersList.DataSource = adapter.GetData(); CustomersList.DataTextField = "CompanyName"; CustomersList.DataValueField = "CustomerID"; CustomersList.DataBind(); CustomersList.Items.Insert(0, ""); }
// constructor public ParkingDatabase(IClock clock, IMailer mailer) { customerTableAdapater = new CustomerTableAdapter(); vehicleTableAdapater = new VehicleTableAdapter(); customerVehicleTableAdapter = new CustomerVehicleTableAdapter(); reservationTableAdapter = new ReservationTableAdapter(); cardTableAdapter = new CreditCardTableAdapter(); customerCardTableAdapter = new CustomerCreditCardTableAdapter(); transactionTableAdapater = new TransactionTableAdapter(); parkingSpotTableAdapter = new ParkingSpotTableAdapter(); DatabaseClock = clock; Mailer = mailer; }
private void rptDeliveryNotes_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { PositionTableAdapter _tdPosition = new PositionTableAdapter(); _tdPosition.FillByProjectID(dsDeliveryNotes1.Position, _Projectid); ProjectTableAdapter _tdProject = new ProjectTableAdapter(); _tdProject.FillByProjectID(dsDeliveryNotes1.Project, _Projectid); CustomerTableAdapter _tdCustomer = new CustomerTableAdapter(); _tdCustomer.FillByCustmerID(dsDeliveryNotes1.Customer, _Custid); }
public void Tables_CustomerRegisterTables_Relationship_DeleteCascadTest() { ConnectionManager.SetConnection("Supervisor", "admin"); BaseTableAdapter tableAdapter = new GenderTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; Tables tables = new Tables(); tableAdapter.Fill(tables.GenderDataTable); tableAdapter = new ApppTprTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.ApppDataTable); tableAdapter = new CustomerTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.CustomerDataTable); tableAdapter = new RegisterTypeTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.RegisterTypeDataTable); tableAdapter = new LandTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.LandDataTable); tableAdapter = new WhyDeRegisterTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.WhyDeRegisterDataTable); tableAdapter = new RegisterTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.RegisterDataTable); int countRows = tables.RegisterDataTable.Rows.Count; int customerId = Int32.Parse(tables.RegisterDataTable.Rows[tables.RegisterDataTable.Rows.Count - 1]["CustomerID"].ToString()); for (int i = 0; i < tables.CustomerDataTable.Rows.Count; i++) { if (Int32.Parse(tables.CustomerDataTable.Rows[i][0].ToString()) == customerId) { tables.CustomerDataTable.Rows[i].Delete(); break; } } tableAdapter = new CustomerTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; ((UpdateBaseTableAdapter)tableAdapter).Update(tables.CustomerDataTable); tableAdapter = new RegisterTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.RegisterDataTable); Assert.IsTrue(countRows - tables.RegisterDataTable.Rows.Count >= 1); }
public void Tables_CustomerInvalidTables_Relationship_DeleteCascadTest() { ConnectionManager.SetConnection("Supervisor", "admin"); BaseTableAdapter tableAdapter = new GenderTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; Tables tables = new Tables(); tableAdapter.Fill(tables.GenderDataTable); tableAdapter = new ApppTprTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.ApppDataTable); tableAdapter = new CustomerTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.CustomerDataTable); tableAdapter = new BenefitsCategoryTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.BenefitsDataTable); tableAdapter = new ChiperReceptTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.ChiperReceptDataTable); tableAdapter = new DisabilityGroupTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.DisabilityGroupDataTable); tableAdapter = new InvalidTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.InvalidDataTable); int countRows = tables.InvalidDataTable.Rows.Count; int customerId = Int32.Parse(tables.InvalidDataTable.Rows[tables.InvalidDataTable.Rows.Count - 1]["CustomerID"].ToString()); for (int i = 0; i < tables.CustomerDataTable.Rows.Count; i++) { if (Int32.Parse(tables.CustomerDataTable.Rows[i][0].ToString()) == customerId) { tables.CustomerDataTable.Rows[i].Delete(); break; } } tableAdapter = new CustomerTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; ((UpdateBaseTableAdapter)tableAdapter).Update(tables.CustomerDataTable); tableAdapter = new InvalidTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.InvalidDataTable); Assert.IsTrue(countRows - tables.InvalidDataTable.Rows.Count >= 1); }
protected void Page_Load(object sender, EventArgs e) { ltlMessage.Text = null; if (!IsPostBack) { CustomerTableAdapter customerTableAdapter = new CustomerTableAdapter(); Customer originalCustomer = customerTableAdapter.GetCustomerByID(Convert.ToInt32(Request["CustomerID"])); txtCustomerName.Text = originalCustomer.CustomerName; txtPhone.Text = originalCustomer.Phone; txtAddress.Text = originalCustomer.Address; imgCustomer.ImageUrl = "~/Upload/" + originalCustomer.ImagePath; ltlImagePath.Text = originalCustomer.ImagePath; } }
/// <summary> /// GetCustomer /// Function to get the customer record related to customer id /// </summary> /// <param name="customerID">Customer ID</param> /// <param name="session">Session object</param> /// <returns>customer row object</returns> public static DAL.CustomerRow GetCustomer(String customerID, ISession session, String VersionNo = "") { CustomerTableAdapter ta = new CustomerTableAdapter(); ta.CurrentConnection = session; List <DAL.CustomerRow> lstCust = ta.GetCustomer(customerID).ToList(); if (lstCust.Count > 0) { return(lstCust[0]); } else { return(null); } }
private void FormSale_Load(object sender, EventArgs e) { txtCashier.Text = $"{Program.StaffID} : {Program.KHName} : {Program.ENGName}"; //Customer CustomerTableAdapter cust_adpater = new CustomerTableAdapter(); cust_adpater.Connection = Program.Connection; cust_adpater.Fill(dataset.Customer); cboCustomer.DisplayMember = "Name"; cboCustomer.ValueMember = "ID"; cboCustomer.DataSource = dataset.Customer; cboCustomer.SelectedIndex = -1; //Category CategoryTableAdapter cate_adapter = new CategoryTableAdapter(); cate_adapter.Connection = Program.Connection; cate_adapter.Fill(dataset.Category); foreach (var cate in dataset.Category) { Button btnCategory = new Button(); btnCategory.Text = cate.Name; btnCategory.Tag = cate.ID; btnCategory.Width = flowLayoutPanel_Category.Width; btnCategory.Height = 30; btnCategory.Click += BtnCategory_Click; flowLayoutPanel_Category.Controls.Add(btnCategory); } // dataGridView_Purchasing_Items.DataSource = dataset.PurchasingItems; dataGridView_Purchasing_Items.Columns[0].Visible = false;//ProductID //add DataGridViewImageColumn plus = new DataGridViewImageColumn(); //plus.HeaderText = ""; plus.ImageLayout = DataGridViewImageCellLayout.Zoom; plus.Image = Properties.Resources.Plus_32px; DataGridViewImageColumn delete = new DataGridViewImageColumn(); //delete.HeaderText = ""; delete.ImageLayout = DataGridViewImageCellLayout.Zoom; delete.Image = Properties.Resources.Cancel_16px1; dataGridView_Purchasing_Items.Columns.Add(plus); dataGridView_Purchasing_Items.Columns.Add(delete); }
public CustomerDataProvider() { dataset = new AdventureWorks2012CustomerDataSet(); adapter = new CustomerTableAdapter(); adapter.Fill(dataset.Customer); SqlCommand sqlcom = new SqlCommand("Select DISTINCT StoreID from AdventureWorks2012.Sales.Customer Order By StoreID", adapter.Connection); adapter.Connection.Open(); SqlDataReader dr = sqlcom.ExecuteReader(); //dataset.Customer.CreateDataReader(); while (dr.Read()) { string item = dr.GetValue(0).ToString(); StoreIds.Add(item); } adapter.Connection.Close(); }
protected void btnYes_Click(object sender, EventArgs e) { CustomerTableAdapter customerTableAdapter = new CustomerTableAdapter(); Customer originalCustomer = customerTableAdapter.GetCustomerByID(Convert.ToInt32(Request["CustomerID"])); Customer customer = new Customer(); customer.ID = originalCustomer.ID; customer.CustomerName = originalCustomer.CustomerName; customer.Phone = originalCustomer.Phone; customer.Address = originalCustomer.Address; customer.ImagePath = originalCustomer.ImagePath; customer.Status = "INACTIVE"; if (customerTableAdapter.Update(customer) > 0) { ltlMessage.Text = "<div class=\"alert alert-success alert-dismissible\"><button type = \"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button> <h4><i class=\"icon fa fa-check\"></i> Alert!</h4> Sucessfully Deleted <b>" + originalCustomer.CustomerName + "</b>.</div>"; Response.Redirect("~/Customers/customerlist.aspx"); } }
protected void btnSave_Click(object sender, EventArgs e) { Customer customer = new Customer(); CustomerTableAdapter customerTableAdapter = new CustomerTableAdapter(); if (IsValidData()) { customer.CustomerName = txtCustomerName.Text.Trim(); customer.Phone = txtPhone.Text.Trim(); customer.Address = txtAddress.Text.Trim(); customer.ImagePath = ltlImagePath.Text; customer.Status = "ACTIVE"; if (customerTableAdapter.Insert(customer) > 0) { ltlMessage.Text = "<div class=\"alert alert-success alert-dismissible\"><button type = \"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button> <h4><i class=\"icon fa fa-check\"></i> Alert!</h4> Sucessfully Created <b>" + txtCustomerName.Text.Trim() + "</b>.</div>"; Response.Redirect("~/Customers/customerlist.aspx"); } } }
public static void CreateNewUsers(CustomerTableAdapter customerTableAdapter, ref BindingSource bindingSource, ref IdeallyConnectedTestDbEntities context) { // Iterating through the list of users from AdventureWorksLT2008 foreach (DataRow customer in customerTableAdapter.GetData().Rows) { Users newUser = new Users(); newUser.Id = Guid.NewGuid().ToString(); newUser.FirstName = (string)customer["FirstName"]; newUser.LastName = (string)customer["LastName"]; newUser.UserName = newUser.FirstName + newUser.LastName + Convert.ToString(random.Next()).Substring(0, 5); newUser.PhoneNumber = (string)customer["Phone"]; newUser.Email = (string)customer["EmailAddress"]; newUser.Created = DateTime.Now; context.Users.Add(newUser); if (bindingSource.Count % 100 == 0) { context.SaveChanges(); } bindingSource.Add(newUser); } }
protected void Page_Load(object sender, EventArgs e) { if (Null.IsNotNull(Request["q"])) { if (Null.IsNotNull(Session["Login"].ToString())) { Session["Login"] = null; Session["Name"] = null; Response.Redirect("~/signin.aspx"); } } if (Null.IsNotNull(Session["Login"]) || Null.IsNotNull(Session["Name"])) { CustomerTableAdapter customerTableAdapter = new CustomerTableAdapter(); DataSet ds = customerTableAdapter.GetCustomerByStatus("ACTIVE"); if (ds.Tables[0].Rows.Count > 0) { Session["dt"] = ds.Tables[0]; PagingDataBind((DataTable)Session["dt"]); } } }
public Task SyncAsync() { Task ta = Task.Run(() => { RepositoryBase <Customer> customerRepository = _unitOfWork.Customers; IList <Customer> sgeCustomers = customerRepository.GetAll(); IList <Customer> irsCustomers = new CustomerTableAdapter(Properties.Settings.Default.IrsDbPath).GetData(); double count = irsCustomers.Count; double current = 0.0; foreach (Customer irsCustomer in irsCustomers) { bool exist = sgeCustomers.Any(cus => cus.CustomerId == irsCustomer.CustomerId); if (!exist) //If new Add it { //sgeCustomers.AddObject(irsCustomer); var newSgeCustomer = new Customer { CustomerId = irsCustomer.CustomerId, Name = irsCustomer.Name }; customerRepository.Add(newSgeCustomer); } else //Otherwise udpate it. { Customer existingCustomer = sgeCustomers.Single(x => x.CustomerId == irsCustomer.CustomerId); existingCustomer.Name = irsCustomer.Name; } current++; double progress = (current / count) * 100; RaiseProgress(progress); } } ); return(ta); }
public void Tables_CustomerAddressTables_TransactionTest() { SqlConnection connection = ConnectionManager.Connection; connection.Open(); SqlTransaction transaction = connection.BeginTransaction(); BaseTableAdapter tableAdapter = new GenderTableAdapter(); tableAdapter.Connection = connection; tableAdapter.Transaction = transaction; Tables tables = new Tables(); tableAdapter.Fill(tables.GenderDataTable); tableAdapter = new ApppTprTableAdapter(); tableAdapter.Connection = connection; tableAdapter.Transaction = transaction; tableAdapter.Fill(tables.ApppDataTable); tableAdapter = new CustomerTableAdapter(); tableAdapter.Connection = connection; tableAdapter.Transaction = transaction; tableAdapter.Fill(tables.CustomerDataTable); tableAdapter = new AdminDivisionTableAdapter(); tableAdapter.Connection = connection; tableAdapter.Transaction = transaction; tableAdapter.Fill(tables.AdminDivisionDataTable); tableAdapter = new TypeStreetTableAdapter(); tableAdapter.Connection = connection; tableAdapter.Transaction = transaction; tableAdapter.Fill(tables.TypeStreetDataTable); tableAdapter = new AddressTableAdapter(); tableAdapter.Connection = connection; tableAdapter.Transaction = transaction; tableAdapter.Fill(tables.AddressDataTable); transaction.Commit(); Assert.IsTrue(tables.AddressDataTable.Rows.Count > 0); }
public CustomerModelController(MainForm mainForm) { this.mainForm = mainForm; customerTableAdapter = new CustomerTableAdapter(); }
// constructor public DAL() { adpCustomer = new CustomerTableAdapter(); tblCustomers = new MyDataSet.CustomerDataTable(); }
private void HardwareForm_Load(object sender, EventArgs e) { try { roomAdapter = new RoomTableAdapter(); customerAdapter = new CustomerTableAdapter(); hardwareAdapter = new HardwareTableAdapter(); hardwareTypeAdapter = new HardwareTypeTableAdapter(); roomAdapter.Connection = cnSql; customerAdapter.Connection = cnSql; hardwareAdapter.Connection = cnSql; hardwareTypeAdapter.Connection = cnSql; roomDataTable = new DataSet.RoomDataTable(); customerDataTable = new DataSet.CustomerDataTable(); hardwareDataTable = new DataSet.HardwareDataTable(); hardwareTypeDataTable = new DataSet.HardwareTypeDataTable(); roomAdapter.Fill(roomDataTable); customerAdapter.Fill(customerDataTable); hardwareAdapter.Fill(hardwareDataTable); hardwareTypeAdapter.Fill(hardwareTypeDataTable); enableForm(false); } catch (Exception ex) { MessageBox.Show(ex.Message); } populateHardwaresList(); populateRoomsList(); populateCustomersList(); populateRoomsList(); populateHardwareTypesList(); }
public void DeleteCustomer(string customerID) { var customer = new Customer.CustomerDataTable(); var customerTableAdapter = new CustomerTableAdapter(); customerTableAdapter.Connection = DataProvider.ConnectionData(sr); int customer1 = customerTableAdapter.DeleteCustomer(customerID); }
public void UpdateCustomer(string CustNum, string First_Name, string Last_Name, string Company, string Address_1, string Address_2, string City, string State, string Zip_Code, string Phone_1, string Phone_2, string CC_Type, string CC_Num, string CC_Exp, string Discount_Level, float Discount_Percent, DateTime? Acct_Open_Date, DateTime? Acct_Close_Date, decimal? Acct_Balance, decimal? Acct_Max_Balance, bool Bonus_Plan_Member, int? Bonus_Points, bool Tax_Exempt, DateTime? Member_Exp, bool Dirty, string Phone_3, string Phone_4, string EMail, string County, string Def_SP, DateTime? CreateDate, string Referral, DateTime? Birthday, DateTime? Last_Birthday_Bonus, DateTime? Last_Visit, bool Require_PONum, int? Max_Charge_NumDays, decimal? Max_Charge_Amount, string License_Num, DateTime? ID_Last_Checked, DateTime? Next_Start_Date, string Checking_AcctNum, bool PrintNotes, short? Loyalty_Plan_ID, int? Tax_Rate_ID, string Bill_To_Name, string Contact_1, string Contact_2, string Terms, string Resale_Num, DateTime? Last_Coupon, short? Account_Type, bool? ChargeAtCost, string original_CustNum) { var customer = new Customer.CustomerDataTable(); var customerTableAdapter = new CustomerTableAdapter(); customerTableAdapter.Connection = DataProvider.ConnectionData(sr); customerTableAdapter.UpdateCustomer(CustNum, First_Name, Last_Name, Company, Address_1, Address_2, City, State, Zip_Code, Phone_1, Phone_2, CC_Type, CC_Num, CC_Exp, Discount_Level, Discount_Percent, Acct_Open_Date, Acct_Close_Date, Acct_Balance, Acct_Max_Balance, Bonus_Plan_Member, Bonus_Points, Tax_Exempt, Member_Exp, Dirty, Phone_3, Phone_4, EMail, County, Def_SP, CreateDate, Referral, Birthday, Last_Birthday_Bonus, Last_Visit, Require_PONum, Max_Charge_NumDays, Max_Charge_Amount, License_Num, ID_Last_Checked, Next_Start_Date, Checking_AcctNum, PrintNotes, Loyalty_Plan_ID, Tax_Rate_ID, Bill_To_Name, Contact_1, Contact_2, Terms, Resale_Num, Last_Coupon, Account_Type, ChargeAtCost, original_CustNum); }
public void SaveDataToDB(string FullPath, string FileName, string excelFileExtension) { SqlTransaction transaction = null; try { DataTable dt = null; dt = this.GetDataSet(FullPath, excelFileExtension).Tables[0]; if (dt.Rows.Count <= 1) { PageUtility.ShowModelDlg(this.Page, "文件中没有任何记录,请重新选择"); return; } CustomerTableAdapter TACustomer = new CustomerTableAdapter(); ImportLogTableAdapter TAImportLog = new ImportLogTableAdapter(); ImportLogDetailTableAdapter TAImportLogDetail = new ImportLogDetailTableAdapter(); MasterDataBLL mdBLL = new MasterDataBLL(); transaction = TableAdapterHelper.BeginTransaction(TACustomer); TableAdapterHelper.SetTransaction(TAImportLog, transaction); TableAdapterHelper.SetTransaction(TAImportLogDetail, transaction); //存储log信息 ImportDS.ImportLogDataTable logTable = new ImportDS.ImportLogDataTable(); ImportDS.ImportLogRow logRow = logTable.NewImportLogRow(); int stuffUserID = ((AuthorizationDS.StuffUserRow)Session["StuffUser"]).StuffUserId; string fullname = this.fileUpLoad.PostedFile.FileName.ToString(); string tmpFile = fullname.Remove(0, fullname.LastIndexOf("\\") + 1); logRow.FileName = tmpFile; logRow.ImportDate = DateTime.Now; logRow.ImportUserID = stuffUserID; logRow.ImportType = 3; logRow.TotalCount = dt.Rows.Count - 1; logRow.SuccessCount = dt.Rows.Count - 1; logRow.FailCount = 0; logTable.AddImportLogRow(logRow); TAImportLog.Update(logTable); //处理每条明细 ERS.CustomerDataTable tbCustomer = new ERS.CustomerDataTable(); ImportDS.ImportLogDetailDataTable ImportLogDetailTable = new ImportDS.ImportLogDetailDataTable(); int row_count = dt.Rows.Count; string errorInfor = string.Empty; // int expenseTypeID = int.Parse(ExpenseTypeDDL.SelectedValue); //开始处理每条明细 for (int i = 1; i <= row_count - 1; i++) { if (CheckData(dt.Rows[i]) != null) { errorInfor = "第" + (i + 1) + "行有错:" + CheckData(dt.Rows[i]); ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } else { DataRow row = dt.Rows[i]; string CustomerNo = row[0].ToString().Trim(); string CustomerName = row[1].ToString().Trim(); string ProvinceName = row[2].ToString().Trim(); string CityName = row[3].ToString().Trim(); string CustomerTypeName = row[4].ToString().Trim(); string ChannelTypeName = row[5].ToString().Trim(); string OUName = row[6].ToString().Trim(); string BudgetOUName = row[7].ToString().Trim(); ERS.CustomerDataTable tbCustomerTemp = mdBLL.GetCustomerByCustomerName(CustomerName); if (tbCustomerTemp != null && tbCustomerTemp.Count > 0) { errorInfor = "第" + (i + 1) + "行有错:已存在客户《" + CustomerName + "》"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } //ERS.ProvinceDataTable tbProvince = mdBLL.GetProvinceByProvinceName(ProvinceName); //if (tbProvince == null || tbProvince.Count == 0) { // errorInfor = "第" + (i + 1) + "行有错:找不到省份《" + ProvinceName + "》"; // ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); // ImportDetailRow.LogID = logRow.LogID; // ImportDetailRow.Line = i + 1; // ImportDetailRow.Error = errorInfor; // ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); // logRow.FailCount = logRow.FailCount + 1; // logRow.SuccessCount = logRow.SuccessCount - 1; // TAImportLog.Update(logRow); // continue; //} ERS.CityDataTable tbCity = mdBLL.GetCityByCityName(CityName); if (tbCity == null || tbCity.Count == 0) { errorInfor = "第" + (i + 1) + "行有错:找不到城市《" + CityName + "》"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } ERS.CustomerTypeDataTable tbCustomerType = mdBLL.GetCustomerTypeByCustomerTypeName(CustomerTypeName); if (tbCustomerType == null || tbCustomerType.Count == 0) { errorInfor = "第" + (i + 1) + "行有错:找不到客户类型《" + CustomerTypeName + "》"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } ERS.ChannelTypeDataTable tbChannelType = mdBLL.GetChannelTypeByChannelTypeName(ChannelTypeName); if (tbChannelType == null || tbChannelType.Count == 0) { errorInfor = "第" + (i + 1) + "行有错:找不到客户渠道《" + ChannelTypeName + "》"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } AuthorizationDS.OrganizationUnitDataTable ouTable = new OUTreeBLL().GetDataByOrganizationUnitName(OUName); if (ouTable == null || ouTable.Count == 0) { errorInfor = "第" + (i + 1) + "行有错:系统中找不到此部门《" + OUName + "》"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } if (ouTable.Count > 1) { errorInfor = "第" + (i + 1) + "行有错:系统中找到多个此名称的部门《" + OUName + "》"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } AuthorizationDS.OrganizationUnitDataTable BudgetOUTable = new OUTreeBLL().GetDataByOrganizationUnitName(BudgetOUName); if (BudgetOUTable == null || BudgetOUTable.Count == 0) { errorInfor = "第" + (i + 1) + "行有错:系统中找不到此部门《" + BudgetOUName + "》"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } if (BudgetOUTable.Count > 1) { errorInfor = "第" + (i + 1) + "行有错:系统中找到多个此名称的部门《" + BudgetOUName + "》"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } ERS.CustomerRow rowCustomer = tbCustomer.NewCustomerRow(); rowCustomer.CustomerNo = CustomerNo; rowCustomer.CustomerName = CustomerName; rowCustomer.CityID = tbCity[0].CityID; rowCustomer.CustomerTypeID = tbCustomerType[0].CustomerTypeID; rowCustomer.ChannelTypeID = tbChannelType[0].ChannelTypeID; rowCustomer.OrganizationUnitID = ouTable[0].OrganizationUnitId; rowCustomer.ApplyOrganizationUnitID = BudgetOUTable[0].OrganizationUnitId; rowCustomer.IsActive = true; tbCustomer.AddCustomerRow(rowCustomer); TACustomer.Update(rowCustomer); } } TAImportLog.Update(logRow); TAImportLogDetail.Update(ImportLogDetailTable); transaction.Commit(); string returnString = "成功导入" + logRow.SuccessCount.ToString() + "条信息"; PageUtility.ShowModelDlg(this.Page, returnString); } catch (Exception ex) { if (transaction != null) { transaction.Rollback(); } PageUtility.ShowModelDlg(this.Page, "Save Fail!" + ex.ToString()); } finally { if (transaction != null) { transaction.Dispose(); } } }
public static void LoadCustomerData() { if (fingerPrintDB == null) { fingerPrintDB = new List<Customer>(); lastUpdatedFingerPrintDB = null; } DataTable customerData; if (lastUpdatedFingerPrintDB == null) { lastUpdatedFingerPrintDB = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue; customerData = new CustomerTableAdapter().GetData(); } else { customerData = new CustomerTableAdapter().GetDataFromDate(lastUpdatedFingerPrintDB.Value , lastUpdatedFingerPrintDB.Value); } lock (fingerPrintDB) { foreach (DataRow row in customerData.Rows) { DateTime lastUpdated = row.Field<DateTime>("LastUpdated"); DateTime? lastUpdatedFingerPrint = row.Field<DateTime?>("LastUpdatedFingerPrint"); if (lastUpdated > lastUpdatedFingerPrintDB || lastUpdatedFingerPrint > lastUpdatedFingerPrintDB) { string username = row.Field<string>("Username"); bool isActive = row.Field<bool>("IsActive"); string typeShortName = row.Field<string>("TypeShortName"); int index = 0; bool found = false; for (; index < fingerPrintDB.Count; index++) { if (fingerPrintDB[index].Username == username) { found = true; break; } } if (lastUpdated > lastUpdatedFingerPrintDB) { if (isActive && typeShortName != Customer.DefaultTypeShortName) { int mealValue = row.Field<int>("MealValue"); bool canDebt = row.Field<bool>("CanDebt"); bool canEatMore = row.Field<bool>("CanEatMore"); int? moreMealValue = row.Field<int?>("MoreMealValue"); if (found) { //update customer fingerPrintDB[index].MealValue = mealValue; fingerPrintDB[index].CanDebt = canDebt; fingerPrintDB[index].CanEatMore = canEatMore; fingerPrintDB[index].MoreMealValue = moreMealValue; } else { if (lastUpdatedFingerPrint != null) { //insert customer fingerPrintDB.Add(new Customer() { Username = username, TypetShortName = typeShortName, MealValue = mealValue, CanDebt = canDebt, CanEatMore = canEatMore, MoreMealValue = moreMealValue }); index = fingerPrintDB.Count - 1; } } } else { if (found) { //remove customer fingerPrintDB.RemoveAt(index); } continue; } } if (lastUpdatedFingerPrint > lastUpdatedFingerPrintDB) { if (found) { Fingerprint fp = new Fingerprint(); MemoryStream ms = new MemoryStream(row.Field<byte[]>("FingerPrintIMG")); Image returnImage = Image.FromStream(ms); fp.AsBitmap = (Bitmap)returnImage; fingerPrintDB[index].Fingerprints = new List<Fingerprint>(); fingerPrintDB[index].Fingerprints.Add(fp); afis.Extract(fingerPrintDB[index]); } } } } lastUpdatedFingerPrintDB = XmlSync.GetLastSync(); } }
public bool updateCustomer(string name, string add, string ph, string aadhar, int id) { objCustomer = new CustomerTableAdapter(); return(objCustomer.UpdateCustomer(name, add, ph, aadhar, id) > 0); }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.lstInvoices = new System.Windows.Forms.ListView(); this.InvoiceID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.AccName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.InvoiceDate = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.TotalPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.lstInvoiceMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.SaveDocumentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SaveCashPayDocumentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SaveChequeDocumentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.lstInvoiceItems = new System.Windows.Forms.ListView(); this.ID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.ItemID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.ItemName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.Count = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.price = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.btnDeleteInvoice = new System.Windows.Forms.Button(); this.abrDateStart = new AbrAfzarGostaran.Windows.Forms.AbrPersianDatePicker(); this.abrDateEnd = new AbrAfzarGostaran.Windows.Forms.AbrPersianDatePicker(); this.txtPriceStart = new System.Windows.Forms.TextBox(); this.txtPriceEnd = new System.Windows.Forms.TextBox(); this.btnApplyFilter = new System.Windows.Forms.Button(); this.lstDistributors = new System.Windows.Forms.ListView(); this.checkboxes = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.AccountantID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.AccountantName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.AccountantPhone = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); this.label1 = new System.Windows.Forms.Label(); this.lstCustomers = new System.Windows.Forms.ListView(); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.label2 = new System.Windows.Forms.Label(); this.btnCheckAllDistributors = new System.Windows.Forms.Button(); this.btnCheckAllCustomers = new System.Windows.Forms.Button(); this.btnUncheckAllCustomers = new System.Windows.Forms.Button(); this.btnUncheckAllDistributors = new System.Windows.Forms.Button(); this.groupBoxPay = new System.Windows.Forms.GroupBox(); this.rdbtnUnpaidOnly = new System.Windows.Forms.RadioButton(); this.rdbtnPaidOnly = new System.Windows.Forms.RadioButton(); this.rdbtnPaymentAll = new System.Windows.Forms.RadioButton(); this.btnTogglePaid = new System.Windows.Forms.Button(); this.invoiceTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.InvoiceTableAdapter(); this.viewItemNameOnInvoiceItemTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.ViewItemNameOnInvoiceItemTableAdapter(); this.invoiceItemTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.InvoiceItemTableAdapter(); this.distributorTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.DistributorTableAdapter(); this.customerTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.CustomerTableAdapter(); this.abrDateNew = new AbrAfzarGostaran.Windows.Forms.AbrPersianDatePicker(); this.btnChangeDate = new System.Windows.Forms.Button(); this.groupBoxDate = new System.Windows.Forms.GroupBox(); this.chkEndDate = new System.Windows.Forms.CheckBox(); this.chkStartDate = new System.Windows.Forms.CheckBox(); this.chequeTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.ChequeTableAdapter(); this.btnEditInvoice = new System.Windows.Forms.Button(); this.chkStartPrice = new System.Windows.Forms.CheckBox(); this.chkEndPrice = new System.Windows.Forms.CheckBox(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.txtInvoiceIDSearch = new System.Windows.Forms.TextBox(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.lstInvoiceMenuStrip.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); this.groupBoxPay.SuspendLayout(); this.groupBoxDate.SuspendLayout(); this.SuspendLayout(); // // lstInvoices // this.lstInvoices.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lstInvoices.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.InvoiceID, this.AccName, this.InvoiceDate, this.TotalPrice, this.columnHeader7, this.columnHeader5, this.columnHeader6}); this.lstInvoices.ContextMenuStrip = this.lstInvoiceMenuStrip; this.lstInvoices.FullRowSelect = true; this.lstInvoices.HideSelection = false; this.lstInvoices.Location = new System.Drawing.Point(440, 10); this.lstInvoices.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.lstInvoices.MultiSelect = false; this.lstInvoices.Name = "lstInvoices"; this.lstInvoices.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.lstInvoices.RightToLeftLayout = true; this.lstInvoices.Size = new System.Drawing.Size(457, 599); this.lstInvoices.TabIndex = 0; this.lstInvoices.UseCompatibleStateImageBehavior = false; this.lstInvoices.View = System.Windows.Forms.View.Details; this.lstInvoices.VirtualMode = true; this.lstInvoices.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lstInvoices_ColumnClick); this.lstInvoices.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.lstInvoices_RetrieveVirtualItem); this.lstInvoices.SelectedIndexChanged += new System.EventHandler(this.lstInvoices_SelectedIndexChanged_1); this.lstInvoices.DoubleClick += new System.EventHandler(this.lstInvoices_DoubleClick); // // InvoiceID // this.InvoiceID.Text = "شماره"; this.InvoiceID.Width = 42; // // AccName // this.AccName.Text = "طرف حساب"; this.AccName.Width = 70; // // InvoiceDate // this.InvoiceDate.Text = "تاریخ "; this.InvoiceDate.Width = 75; // // TotalPrice // this.TotalPrice.Text = "مبلغ کل"; this.TotalPrice.Width = 80; // // columnHeader7 // this.columnHeader7.Text = "تخفیف"; this.columnHeader7.Width = 67; // // columnHeader5 // this.columnHeader5.Text = "نوع"; this.columnHeader5.Width = 40; // // columnHeader6 // this.columnHeader6.Text = "پرداخت"; this.columnHeader6.Width = 54; // // lstInvoiceMenuStrip // this.lstInvoiceMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.SaveDocumentToolStripMenuItem, this.SaveCashPayDocumentToolStripMenuItem, this.SaveChequeDocumentToolStripMenuItem}); this.lstInvoiceMenuStrip.Name = "lstInvoiceMenuStrip"; this.lstInvoiceMenuStrip.Size = new System.Drawing.Size(165, 92); // // SaveDocumentToolStripMenuItem // this.SaveDocumentToolStripMenuItem.Name = "SaveDocumentToolStripMenuItem"; this.SaveDocumentToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.SaveDocumentToolStripMenuItem.Text = "ثبت سند فاکتور"; this.SaveDocumentToolStripMenuItem.Click += new System.EventHandler(this.SaveDocumentToolStripMenuItem_Click); // // SaveCashPayDocumentToolStripMenuItem // this.SaveCashPayDocumentToolStripMenuItem.Name = "SaveCashPayDocumentToolStripMenuItem"; this.SaveCashPayDocumentToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.SaveCashPayDocumentToolStripMenuItem.Text = "ثبت سند پرداخت نقد"; this.SaveCashPayDocumentToolStripMenuItem.Click += new System.EventHandler(this.SaveCashPayDocumentToolStripMenuItem_Click); // // SaveChequeDocumentToolStripMenuItem // this.SaveChequeDocumentToolStripMenuItem.Name = "SaveChequeDocumentToolStripMenuItem"; this.SaveChequeDocumentToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.SaveChequeDocumentToolStripMenuItem.Text = "ثبت سند چک فاکتور"; this.SaveChequeDocumentToolStripMenuItem.Click += new System.EventHandler(this.SaveChequeDocumentToolStripMenuItem_Click); // // lstInvoiceItems // this.lstInvoiceItems.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lstInvoiceItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.ID, this.ItemID, this.ItemName, this.Count, this.price}); this.lstInvoiceItems.FullRowSelect = true; this.lstInvoiceItems.HideSelection = false; this.lstInvoiceItems.Location = new System.Drawing.Point(14, 10); this.lstInvoiceItems.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.lstInvoiceItems.Name = "lstInvoiceItems"; this.lstInvoiceItems.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.lstInvoiceItems.RightToLeftLayout = true; this.lstInvoiceItems.Size = new System.Drawing.Size(418, 599); this.lstInvoiceItems.TabIndex = 0; this.lstInvoiceItems.UseCompatibleStateImageBehavior = false; this.lstInvoiceItems.View = System.Windows.Forms.View.Details; this.lstInvoiceItems.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.list_ColumnClick); // // ID // this.ID.Text = "ردیف"; this.ID.Width = 40; // // ItemID // this.ItemID.Text = "کد کالا"; this.ItemID.Width = 71; // // ItemName // this.ItemName.Text = "نام کالا"; this.ItemName.Width = 131; // // Count // this.Count.Text = "تعداد"; this.Count.Width = 50; // // price // this.price.Text = "فی واحد"; this.price.Width = 62; // // btnDeleteInvoice // this.btnDeleteInvoice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnDeleteInvoice.Enabled = false; this.btnDeleteInvoice.Image = global::Store.Properties.Resources.cancel; this.btnDeleteInvoice.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.btnDeleteInvoice.Location = new System.Drawing.Point(786, 614); this.btnDeleteInvoice.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnDeleteInvoice.Name = "btnDeleteInvoice"; this.btnDeleteInvoice.Size = new System.Drawing.Size(111, 50); this.btnDeleteInvoice.TabIndex = 1; this.btnDeleteInvoice.Text = "حذف فاکتور"; this.btnDeleteInvoice.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.toolTip.SetToolTip(this.btnDeleteInvoice, "حذف کامل فاکتور و تمامی اقلام آن و بازگرداندن/کم کردن موجودی انبار"); this.btnDeleteInvoice.UseVisualStyleBackColor = true; this.btnDeleteInvoice.Click += new System.EventHandler(this.btnDeleteInvoice_Click); // // abrDateStart // this.abrDateStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.abrDateStart.Enabled = false; this.abrDateStart.EndOfYears = 1900; this.abrDateStart.InnerBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(254)))), ((int)(((byte)(254))))); this.abrDateStart.isBorder3D = true; this.abrDateStart.ItemsFont = new System.Drawing.Font("B Roya", 15F, System.Drawing.FontStyle.Bold); this.abrDateStart.LinearListFont = new System.Drawing.Font("B Roya", 15F, System.Drawing.FontStyle.Bold); this.abrDateStart.Location = new System.Drawing.Point(7, 61); this.abrDateStart.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.abrDateStart.MaximumSize = new System.Drawing.Size(175, 37); this.abrDateStart.MinimumSize = new System.Drawing.Size(175, 37); this.abrDateStart.Name = "abrDateStart"; this.abrDateStart.OuterBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); this.abrDateStart.PanelEndBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(202)))), ((int)(((byte)(202))))); this.abrDateStart.PanelStartBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(239)))), ((int)(((byte)(239))))); this.abrDateStart.SelectedDate = new System.DateTime(2014, 10, 19, 1, 1, 1, 1); this.abrDateStart.SelectedDateString = "1393/07/27"; this.abrDateStart.SelectedMonthName = null; this.abrDateStart.Size = new System.Drawing.Size(175, 37); this.abrDateStart.StartOfYears = 1350; this.abrDateStart.TabIndex = 3; this.toolTip.SetToolTip(this.abrDateStart, "تاریخ شروع فیلترگذاری"); // // abrDateEnd // this.abrDateEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.abrDateEnd.Enabled = false; this.abrDateEnd.EndOfYears = 1900; this.abrDateEnd.InnerBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(254)))), ((int)(((byte)(254))))); this.abrDateEnd.isBorder3D = true; this.abrDateEnd.ItemsFont = new System.Drawing.Font("B Roya", 15F, System.Drawing.FontStyle.Bold); this.abrDateEnd.LinearListFont = new System.Drawing.Font("B Roya", 15F, System.Drawing.FontStyle.Bold); this.abrDateEnd.Location = new System.Drawing.Point(7, 139); this.abrDateEnd.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.abrDateEnd.MaximumSize = new System.Drawing.Size(175, 37); this.abrDateEnd.MinimumSize = new System.Drawing.Size(175, 37); this.abrDateEnd.Name = "abrDateEnd"; this.abrDateEnd.OuterBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); this.abrDateEnd.PanelEndBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(202)))), ((int)(((byte)(202))))); this.abrDateEnd.PanelStartBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(239)))), ((int)(((byte)(239))))); this.abrDateEnd.SelectedDate = new System.DateTime(2014, 10, 19, 1, 1, 1, 1); this.abrDateEnd.SelectedDateString = "1393/07/27"; this.abrDateEnd.SelectedMonthName = null; this.abrDateEnd.Size = new System.Drawing.Size(175, 37); this.abrDateEnd.StartOfYears = 1350; this.abrDateEnd.TabIndex = 3; this.toolTip.SetToolTip(this.abrDateEnd, "تاریخ پایان فیلترگذاری"); // // txtPriceStart // this.txtPriceStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtPriceStart.Enabled = false; this.txtPriceStart.Location = new System.Drawing.Point(905, 323); this.txtPriceStart.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtPriceStart.Name = "txtPriceStart"; this.txtPriceStart.Size = new System.Drawing.Size(187, 27); this.txtPriceStart.TabIndex = 7; this.txtPriceStart.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtPriceStart_KeyPress); // // txtPriceEnd // this.txtPriceEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtPriceEnd.Enabled = false; this.txtPriceEnd.Location = new System.Drawing.Point(905, 392); this.txtPriceEnd.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtPriceEnd.Name = "txtPriceEnd"; this.txtPriceEnd.Size = new System.Drawing.Size(187, 27); this.txtPriceEnd.TabIndex = 7; this.txtPriceEnd.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtPriceEnd_KeyPress); // // btnApplyFilter // this.btnApplyFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnApplyFilter.Location = new System.Drawing.Point(904, 608); this.btnApplyFilter.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnApplyFilter.Name = "btnApplyFilter"; this.btnApplyFilter.Size = new System.Drawing.Size(189, 56); this.btnApplyFilter.TabIndex = 10; this.btnApplyFilter.Text = "فیلترگذاری"; this.btnApplyFilter.UseVisualStyleBackColor = true; this.btnApplyFilter.Click += new System.EventHandler(this.btnApplyFilter_Click); // // lstDistributors // this.lstDistributors.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lstDistributors.CheckBoxes = true; this.lstDistributors.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.checkboxes, this.AccountantID, this.AccountantName, this.AccountantPhone}); this.lstDistributors.FullRowSelect = true; this.lstDistributors.HideSelection = false; this.lstDistributors.Location = new System.Drawing.Point(1099, 41); this.lstDistributors.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.lstDistributors.Name = "lstDistributors"; this.lstDistributors.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.lstDistributors.RightToLeftLayout = true; this.lstDistributors.Size = new System.Drawing.Size(254, 289); this.lstDistributors.TabIndex = 11; this.lstDistributors.UseCompatibleStateImageBehavior = false; this.lstDistributors.View = System.Windows.Forms.View.Details; this.lstDistributors.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.list_ColumnClick); // // checkboxes // this.checkboxes.Text = ""; this.checkboxes.Width = 20; // // AccountantID // this.AccountantID.Text = "شناسه"; this.AccountantID.Width = 43; // // AccountantName // this.AccountantName.Text = "نام"; this.AccountantName.Width = 89; // // AccountantPhone // this.AccountantPhone.Text = "تلفن"; this.AccountantPhone.Width = 62; // // errorProvider // this.errorProvider.ContainerControl = this; // // label1 // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(1268, 18); this.label1.Name = "label1"; this.label1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label1.Size = new System.Drawing.Size(81, 20); this.label1.TabIndex = 12; this.label1.Text = "توزیع کننده ها"; this.label1.Visible = false; // // lstCustomers // this.lstCustomers.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lstCustomers.CheckBoxes = true; this.lstCustomers.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, this.columnHeader2, this.columnHeader3, this.columnHeader4}); this.lstCustomers.FullRowSelect = true; this.lstCustomers.HideSelection = false; this.lstCustomers.Location = new System.Drawing.Point(1100, 370); this.lstCustomers.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.lstCustomers.Name = "lstCustomers"; this.lstCustomers.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.lstCustomers.RightToLeftLayout = true; this.lstCustomers.Size = new System.Drawing.Size(254, 292); this.lstCustomers.TabIndex = 11; this.lstCustomers.UseCompatibleStateImageBehavior = false; this.lstCustomers.View = System.Windows.Forms.View.Details; this.lstCustomers.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.list_ColumnClick); // // columnHeader1 // this.columnHeader1.Text = ""; this.columnHeader1.Width = 20; // // columnHeader2 // this.columnHeader2.Text = "شناسه"; this.columnHeader2.Width = 43; // // columnHeader3 // this.columnHeader3.Text = "نام"; this.columnHeader3.Width = 80; // // columnHeader4 // this.columnHeader4.Text = "بدهی"; this.columnHeader4.Width = 76; // // label2 // this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(1295, 346); this.label2.Name = "label2"; this.label2.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label2.Size = new System.Drawing.Size(61, 20); this.label2.TabIndex = 13; this.label2.Text = "مشتری ها"; this.label2.Visible = false; // // btnCheckAllDistributors // this.btnCheckAllDistributors.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnCheckAllDistributors.Location = new System.Drawing.Point(1099, 12); this.btnCheckAllDistributors.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnCheckAllDistributors.Name = "btnCheckAllDistributors"; this.btnCheckAllDistributors.Size = new System.Drawing.Size(87, 29); this.btnCheckAllDistributors.TabIndex = 14; this.btnCheckAllDistributors.Text = "انتخاب همه"; this.btnCheckAllDistributors.UseVisualStyleBackColor = true; this.btnCheckAllDistributors.Click += new System.EventHandler(this.btnCheckAllDistributors_Click); // // btnCheckAllCustomers // this.btnCheckAllCustomers.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnCheckAllCustomers.Location = new System.Drawing.Point(1100, 341); this.btnCheckAllCustomers.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnCheckAllCustomers.Name = "btnCheckAllCustomers"; this.btnCheckAllCustomers.Size = new System.Drawing.Size(87, 29); this.btnCheckAllCustomers.TabIndex = 14; this.btnCheckAllCustomers.Text = "انتخاب همه"; this.btnCheckAllCustomers.UseVisualStyleBackColor = true; this.btnCheckAllCustomers.Click += new System.EventHandler(this.btnCheckAllCustomers_Click); // // btnUncheckAllCustomers // this.btnUncheckAllCustomers.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnUncheckAllCustomers.Location = new System.Drawing.Point(1195, 341); this.btnUncheckAllCustomers.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnUncheckAllCustomers.Name = "btnUncheckAllCustomers"; this.btnUncheckAllCustomers.Size = new System.Drawing.Size(76, 29); this.btnUncheckAllCustomers.TabIndex = 14; this.btnUncheckAllCustomers.Text = "حذف همه"; this.btnUncheckAllCustomers.UseVisualStyleBackColor = true; this.btnUncheckAllCustomers.Click += new System.EventHandler(this.btnUncheckAllCustomers_Click); // // btnUncheckAllDistributors // this.btnUncheckAllDistributors.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnUncheckAllDistributors.Location = new System.Drawing.Point(1193, 12); this.btnUncheckAllDistributors.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnUncheckAllDistributors.Name = "btnUncheckAllDistributors"; this.btnUncheckAllDistributors.Size = new System.Drawing.Size(76, 29); this.btnUncheckAllDistributors.TabIndex = 14; this.btnUncheckAllDistributors.Text = "حذف همه"; this.btnUncheckAllDistributors.UseVisualStyleBackColor = true; this.btnUncheckAllDistributors.Click += new System.EventHandler(this.btnUncheckAllDistributors_Click); // // groupBoxPay // this.groupBoxPay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxPay.Controls.Add(this.rdbtnUnpaidOnly); this.groupBoxPay.Controls.Add(this.rdbtnPaidOnly); this.groupBoxPay.Controls.Add(this.rdbtnPaymentAll); this.groupBoxPay.Controls.Add(this.btnTogglePaid); this.groupBoxPay.Location = new System.Drawing.Point(904, 430); this.groupBoxPay.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBoxPay.Name = "groupBoxPay"; this.groupBoxPay.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBoxPay.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.groupBoxPay.Size = new System.Drawing.Size(188, 170); this.groupBoxPay.TabIndex = 15; this.groupBoxPay.TabStop = false; this.groupBoxPay.Text = "وضعیت پرداخت"; // // rdbtnUnpaidOnly // this.rdbtnUnpaidOnly.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.rdbtnUnpaidOnly.AutoSize = true; this.rdbtnUnpaidOnly.Location = new System.Drawing.Point(85, 95); this.rdbtnUnpaidOnly.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.rdbtnUnpaidOnly.Name = "rdbtnUnpaidOnly"; this.rdbtnUnpaidOnly.Size = new System.Drawing.Size(96, 24); this.rdbtnUnpaidOnly.TabIndex = 0; this.rdbtnUnpaidOnly.Text = "پرداخت نشده"; this.rdbtnUnpaidOnly.UseVisualStyleBackColor = true; this.rdbtnUnpaidOnly.CheckedChanged += new System.EventHandler(this.rdbtnUnpaidOnly_CheckedChanged); // // rdbtnPaidOnly // this.rdbtnPaidOnly.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.rdbtnPaidOnly.AutoSize = true; this.rdbtnPaidOnly.Location = new System.Drawing.Point(88, 61); this.rdbtnPaidOnly.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.rdbtnPaidOnly.Name = "rdbtnPaidOnly"; this.rdbtnPaidOnly.Size = new System.Drawing.Size(92, 24); this.rdbtnPaidOnly.TabIndex = 0; this.rdbtnPaidOnly.Text = "پرداخت شده"; this.rdbtnPaidOnly.UseVisualStyleBackColor = true; this.rdbtnPaidOnly.CheckedChanged += new System.EventHandler(this.rdbtnPaidOnly_CheckedChanged); // // rdbtnPaymentAll // this.rdbtnPaymentAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.rdbtnPaymentAll.AutoSize = true; this.rdbtnPaymentAll.Checked = true; this.rdbtnPaymentAll.Location = new System.Drawing.Point(135, 28); this.rdbtnPaymentAll.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.rdbtnPaymentAll.Name = "rdbtnPaymentAll"; this.rdbtnPaymentAll.Size = new System.Drawing.Size(46, 24); this.rdbtnPaymentAll.TabIndex = 0; this.rdbtnPaymentAll.TabStop = true; this.rdbtnPaymentAll.Text = "همه"; this.rdbtnPaymentAll.UseVisualStyleBackColor = true; this.rdbtnPaymentAll.CheckedChanged += new System.EventHandler(this.rdbtnPaymentAll_CheckedChanged); // // btnTogglePaid // this.btnTogglePaid.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnTogglePaid.Location = new System.Drawing.Point(52, 123); this.btnTogglePaid.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnTogglePaid.Name = "btnTogglePaid"; this.btnTogglePaid.Size = new System.Drawing.Size(128, 38); this.btnTogglePaid.TabIndex = 1; this.btnTogglePaid.Text = "تغییر وضعیت پرداخت"; this.btnTogglePaid.UseVisualStyleBackColor = true; this.btnTogglePaid.Click += new System.EventHandler(this.btnTogglePaid_Click); // // invoiceTableAdapter // this.invoiceTableAdapter.ClearBeforeFill = true; // // viewItemNameOnInvoiceItemTableAdapter // this.viewItemNameOnInvoiceItemTableAdapter.ClearBeforeFill = true; // // invoiceItemTableAdapter // this.invoiceItemTableAdapter.ClearBeforeFill = true; // // distributorTableAdapter // this.distributorTableAdapter.ClearBeforeFill = true; // // customerTableAdapter // this.customerTableAdapter.ClearBeforeFill = true; // // abrDateNew // this.abrDateNew.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.abrDateNew.EndOfYears = 1900; this.abrDateNew.InnerBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(254)))), ((int)(((byte)(254))))); this.abrDateNew.isBorder3D = true; this.abrDateNew.ItemsFont = new System.Drawing.Font("B Roya", 15F, System.Drawing.FontStyle.Bold); this.abrDateNew.LinearListFont = new System.Drawing.Font("B Roya", 15F, System.Drawing.FontStyle.Bold); this.abrDateNew.Location = new System.Drawing.Point(6, 231); this.abrDateNew.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.abrDateNew.MaximumSize = new System.Drawing.Size(175, 37); this.abrDateNew.MinimumSize = new System.Drawing.Size(175, 37); this.abrDateNew.Name = "abrDateNew"; this.abrDateNew.OuterBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); this.abrDateNew.PanelEndBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(202)))), ((int)(((byte)(202))))); this.abrDateNew.PanelStartBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(239)))), ((int)(((byte)(239))))); this.abrDateNew.SelectedDate = new System.DateTime(2012, 4, 3, 1, 1, 1, 1); this.abrDateNew.SelectedDateString = "1391/01/15"; this.abrDateNew.SelectedMonthName = null; this.abrDateNew.Size = new System.Drawing.Size(175, 37); this.abrDateNew.StartOfYears = 1350; this.abrDateNew.TabIndex = 3; this.toolTip.SetToolTip(this.abrDateNew, "تاریخ جدید فاکتور"); // // btnChangeDate // this.btnChangeDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnChangeDate.Enabled = false; this.btnChangeDate.Location = new System.Drawing.Point(70, 184); this.btnChangeDate.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnChangeDate.Name = "btnChangeDate"; this.btnChangeDate.Size = new System.Drawing.Size(108, 38); this.btnChangeDate.TabIndex = 1; this.btnChangeDate.Text = "تغییر تاریخ به:"; this.btnChangeDate.UseVisualStyleBackColor = true; this.btnChangeDate.Click += new System.EventHandler(this.btnChangeDate_Click); // // groupBoxDate // this.groupBoxDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxDate.Controls.Add(this.abrDateStart); this.groupBoxDate.Controls.Add(this.abrDateEnd); this.groupBoxDate.Controls.Add(this.abrDateNew); this.groupBoxDate.Controls.Add(this.btnChangeDate); this.groupBoxDate.Controls.Add(this.chkEndDate); this.groupBoxDate.Controls.Add(this.chkStartDate); this.groupBoxDate.Location = new System.Drawing.Point(904, 10); this.groupBoxDate.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBoxDate.Name = "groupBoxDate"; this.groupBoxDate.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBoxDate.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.groupBoxDate.Size = new System.Drawing.Size(188, 278); this.groupBoxDate.TabIndex = 16; this.groupBoxDate.TabStop = false; this.groupBoxDate.Text = "تاریخ"; // // chkEndDate // this.chkEndDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.chkEndDate.AutoSize = true; this.chkEndDate.Location = new System.Drawing.Point(116, 107); this.chkEndDate.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.chkEndDate.Name = "chkEndDate"; this.chkEndDate.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.chkEndDate.Size = new System.Drawing.Size(66, 24); this.chkEndDate.TabIndex = 2; this.chkEndDate.Text = "تا تاریخ"; this.chkEndDate.UseVisualStyleBackColor = true; this.chkEndDate.CheckedChanged += new System.EventHandler(this.chkEndDate_CheckedChanged); // // chkStartDate // this.chkStartDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.chkStartDate.AutoSize = true; this.chkStartDate.Location = new System.Drawing.Point(113, 28); this.chkStartDate.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.chkStartDate.Name = "chkStartDate"; this.chkStartDate.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.chkStartDate.Size = new System.Drawing.Size(67, 24); this.chkStartDate.TabIndex = 2; this.chkStartDate.Text = "از تاریخ"; this.chkStartDate.UseVisualStyleBackColor = true; this.chkStartDate.CheckedChanged += new System.EventHandler(this.chkStartDate_CheckedChanged); // // chequeTableAdapter // this.chequeTableAdapter.ClearBeforeFill = true; // // btnEditInvoice // this.btnEditInvoice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnEditInvoice.Enabled = false; this.btnEditInvoice.Location = new System.Drawing.Point(440, 620); this.btnEditInvoice.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnEditInvoice.Name = "btnEditInvoice"; this.btnEditInvoice.Size = new System.Drawing.Size(115, 38); this.btnEditInvoice.TabIndex = 1; this.btnEditInvoice.Text = "تصحیح فاکتور"; this.btnEditInvoice.UseVisualStyleBackColor = true; this.btnEditInvoice.Click += new System.EventHandler(this.btnEditInvoice_Click); // // chkStartPrice // this.chkStartPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.chkStartPrice.AutoSize = true; this.chkStartPrice.Location = new System.Drawing.Point(1027, 295); this.chkStartPrice.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.chkStartPrice.Name = "chkStartPrice"; this.chkStartPrice.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.chkStartPrice.Size = new System.Drawing.Size(65, 24); this.chkStartPrice.TabIndex = 2; this.chkStartPrice.Text = "از مبلغ"; this.chkStartPrice.UseVisualStyleBackColor = true; this.chkStartPrice.CheckedChanged += new System.EventHandler(this.chkStartPrice_CheckedChanged); // // chkEndPrice // this.chkEndPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.chkEndPrice.AutoSize = true; this.chkEndPrice.Location = new System.Drawing.Point(1028, 358); this.chkEndPrice.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.chkEndPrice.Name = "chkEndPrice"; this.chkEndPrice.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.chkEndPrice.Size = new System.Drawing.Size(64, 24); this.chkEndPrice.TabIndex = 2; this.chkEndPrice.Text = "تا مبلغ"; this.chkEndPrice.UseVisualStyleBackColor = true; this.chkEndPrice.CheckedChanged += new System.EventHandler(this.chkEndPrice_CheckedChanged); // // timer1 // this.timer1.Enabled = true; this.timer1.Interval = 500; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // txtInvoiceIDSearch // this.txtInvoiceIDSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtInvoiceIDSearch.Location = new System.Drawing.Point(562, 626); this.txtInvoiceIDSearch.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtInvoiceIDSearch.Name = "txtInvoiceIDSearch"; this.txtInvoiceIDSearch.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtInvoiceIDSearch.Size = new System.Drawing.Size(216, 27); this.txtInvoiceIDSearch.TabIndex = 7; this.txtInvoiceIDSearch.Text = "جستجو با شماره فاکتور"; this.toolTip.SetToolTip(this.txtInvoiceIDSearch, "برای جستجو شماره فاکتور را تایپ کرده کلید\r\nEnter\r\nرا بزنید"); this.txtInvoiceIDSearch.Enter += new System.EventHandler(this.txtInvoiceIDSearch_Enter); this.txtInvoiceIDSearch.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtInvoiceIDSearch_KeyPress); this.txtInvoiceIDSearch.Leave += new System.EventHandler(this.txtInvoiceIDSearch_Leave); // // toolTip // this.toolTip.AutomaticDelay = 100; this.toolTip.AutoPopDelay = 10000; this.toolTip.InitialDelay = 100; this.toolTip.IsBalloon = true; this.toolTip.ReshowDelay = 20; // // InvoiceManageForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 19F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.BlueViolet; this.ClientSize = new System.Drawing.Size(1362, 683); this.Controls.Add(this.groupBoxDate); this.Controls.Add(this.groupBoxPay); this.Controls.Add(this.btnUncheckAllDistributors); this.Controls.Add(this.btnUncheckAllCustomers); this.Controls.Add(this.btnCheckAllCustomers); this.Controls.Add(this.chkEndPrice); this.Controls.Add(this.chkStartPrice); this.Controls.Add(this.btnCheckAllDistributors); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.lstCustomers); this.Controls.Add(this.lstDistributors); this.Controls.Add(this.btnApplyFilter); this.Controls.Add(this.txtPriceEnd); this.Controls.Add(this.txtInvoiceIDSearch); this.Controls.Add(this.txtPriceStart); this.Controls.Add(this.btnEditInvoice); this.Controls.Add(this.btnDeleteInvoice); this.Controls.Add(this.lstInvoiceItems); this.Controls.Add(this.lstInvoices); this.Font = new System.Drawing.Font("XB Roya", 9.25F); this.KeyPreview = true; this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Name = "InvoiceManageForm"; this.Text = "مدیریت فاکتورها"; this.Activated += new System.EventHandler(this.InvoiceManageForm_Activated); this.Load += new System.EventHandler(this.InvoiceManageForm_Load); this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.InvoiceManageForm_KeyPress); this.lstInvoiceMenuStrip.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); this.groupBoxPay.ResumeLayout(false); this.groupBoxPay.PerformLayout(); this.groupBoxDate.ResumeLayout(false); this.groupBoxDate.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
protected void Page_Load(object sender, EventArgs e) { AuthorizationDS.PositionRow position = (AuthorizationDS.PositionRow)this.Session["Position"]; base.Page_Load(sender, e); if (!this.IsPostBack) { String title = this.GetLocalResourceObject("titleLabel.Text").ToString(); PageUtility.SetContentTitle(this.Page, title); MasterDataBLL mdBLL = new MasterDataBLL(); int formID = int.Parse(Request["ObjectId"]); this.ViewState["ObjectId"] = formID; FormDS.FormRow rowForm = this.FormSaleBLL.GetFormByID(formID)[0]; FormDS.FormSaleApplyRow rowFormApply = this.FormSaleBLL.GetFormSaleApplyByID(formID)[0]; if (rowForm.IsProcIDNull()) { ViewState["ProcID"] = ""; } else { ViewState["ProcID"] = rowForm.ProcID; } this.FormNoCtl.Text = rowForm.FormNo; AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID); this.StuffNameCtl.Text = CommonUtility.GetStaffFullName(applicant); this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName; if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null) { this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName; } this.StuffNoCtl.Text = applicant.IsStuffNoNull() ? "" : applicant.StuffNo; this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString(); this.PeriodCtl.Text = rowFormApply.FPeriod.ToString("yyyy-MM"); MasterData.CustomerRow customer = new CustomerTableAdapter().GetDataByID(rowFormApply.CustomerID)[0]; this.txtCustomerCode.Text = customer.CustomerNo; this.CustomerNameCtl.Text = customer.CustomerName; this.CustomerChannelCtl.Text = new CustomerChannelTableAdapter().GetDataByID(customer.CustomerChannelID)[0].CustomerChannelName; this.KATypeCtl.Text = customer.IsKaTypeNull() ? "" : customer.KaType; this.CustomerRegionCtl.Text = new CustomerRegionTableAdapter().GetDataByID(customer.CustomerRegionID)[0].CustomerRegionName; this.CityCtl.Text = customer.City; this.BrandCtl.Text = new BrandTableAdapter().GetDataByID(rowFormApply.BrandID)[0].BrandName; MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = mdBLL.GetExpenseSubCategoryById(rowFormApply.ExpenseSubCategoryID); this.ExpenseCategoryCtl.Text = mdBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID).ExpenseCategoryName; this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName; this.CurrencyCtl.Text = new CurrencyTableAdapter().GetDataByID(rowFormApply.CurrencyID)[0].CurrencyShortName; this.ExchangeRateCtl.Text = rowFormApply.ExchangeRate.ToString(); this.ShopNameCtl.Text = rowFormApply.IsShopNameNull() ? "" : rowFormApply.ShopName; this.ShopCountCtl.Text = rowFormApply.IsShopCountNull() ? "" : rowFormApply.ShopCount.ToString(); this.ProjectNameCtl.Text = rowFormApply.IsProjectNameNull() ? "" : rowFormApply.ProjectName; this.CostCenterCtl.Text = CommonUtility.GetMAACostCenterFullName(rowForm.CostCenterID); //历史单据 if (rowForm.IsRejectedFormIDNull()) { lblRejectFormNo.Text = "无"; } else { FormDS.FormRow rejectedForm = this.FormSaleBLL.GetFormByID(rowForm.RejectedFormID)[0]; this.lblRejectFormNo.Text = rejectedForm.FormNo; this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SampleRequest/SaleSampleRequestApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')"; } this.ProjectDescCtl.Text = rowFormApply.IsProjectDescNull() ? "" : rowFormApply.ProjectDesc; if (!rowFormApply.IsApplyFileNameNull()) this.UCFileUpload.AttachmentFileName = rowFormApply.ApplyFileName; if (!rowFormApply.IsApplyRealFileNameNull()) this.UCFileUpload.RealAttachmentFileName = rowFormApply.ApplyRealFileName; if (!rowFormApply.IsActivityBeginDateNull()) { this.ActivityBeginCtl.Text = rowFormApply.ActivityBeginDate.ToString("yyyy-MM-dd"); } if (!rowFormApply.IsActivityEndDateNull()) { this.ActivityEndCtl.Text = rowFormApply.ActivityEndDate.ToString("yyyy-MM-dd"); } if (!rowFormApply.IsExpectDeliveryDateNull()) { this.txtExpectDeliveryDate.Text = rowFormApply.ExpectDeliveryDate.ToString("yyyy-MM-dd"); } if (!rowFormApply.IsDeliveryAddressNull()) { this.txtDeliveryAddress.Text = rowFormApply.DeliveryAddress; } this.TotalBudgetCtl.Text = rowFormApply.TotalBudget.ToString("N"); this.ApprovedAmountCtl.Text = rowFormApply.ApprovedAmount.ToString("N"); this.ApprovingAmountCtl.Text = rowFormApply.ApprovingAmount.ToString("N"); this.CompletedAmountCtl.Text = rowFormApply.CompletedAmount.ToString("N"); this.ReimbursedAmountCtl.Text = rowFormApply.ReimbursedAmount.ToString("N"); this.RemainBudgetCtl.Text = rowFormApply.RemainBudget.ToString("N"); //明细 this.odsDetails.SelectParameters["FormSaleApplyID"].DefaultValue = rowFormApply.FormSaleApplyID.ToString(); //按钮控制 //审批页面处理&按钮处理 AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"]; this.ViewState["StuffUserID"] = stuffUser.StuffUserId; if (rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P")) { this.SubmitBtn.Visible = true; this.cwfAppCheck.IsView = false; this.ViewState["IsView"] = false; } else { this.SubmitBtn.Visible = false; this.cwfAppCheck.IsView = true; this.ViewState["IsView"] = true; } if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && stuffUser.StuffUserId == rowForm.UserID) { this.EditBtn.Visible = true; this.ScrapBtn.Visible = true; } else { this.EditBtn.Visible = false; this.ScrapBtn.Visible = false; } //如果是弹出,取消按钮不可见 if (this.Request["ShowDialog"] != null) { if (this.Request["ShowDialog"].ToString() == "1") { this.upButton.Visible = false; this.Master.FindControl("divMenu").Visible = false; this.Master.FindControl("tbCurrentPage").Visible = false; } } //查看报销单按钮 if (rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted) { this.IsVisible = ""; } else { this.IsVisible = "none"; } FormDS.FormDeliveryGoodsDataTable tbDelivery = new FormSaleBLL().GetFormDeliveryGoodByFormID(formID); if (tbDelivery.Count > 0) { this.gvDeliveryInfo.DataSource = tbDelivery; this.gvDeliveryInfo.DataBind(); } else { this.divDeliveryInfo.Visible = false; this.gvDeliveryInfo.Visible = false; } //是否显示报销完成按钮 this.CloseBtn.Visible = false; if ((!rowFormApply.IsClose) && rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted) { if (stuffUser.StuffUserId == rowForm.UserID || new AuthorizationBLL().GetProxyReimburseByParameter(rowForm.UserID, stuffUser.StuffUserId, rowForm.SubmitDate).Count > 0) { this.CloseBtn.Visible = true; } } //发货完成按钮权限 int opManageId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.DeliveryComplete, SystemEnums.OperateEnum.Other); PositionRightBLL positionRightBLL = new PositionRightBLL(); bool hasManageRight = positionRightBLL.CheckPositionRight(position.PositionId, opManageId); if (hasManageRight && (rowFormApply.IsIsDeliveryCompleteNull() || rowFormApply.IsDeliveryComplete == false)) { this.DeliveryCompleteBtn.Visible = true; } else { this.DeliveryCompleteBtn.Visible = false; } } //查看预算权限 int opViewId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.ViewBudget, SystemEnums.OperateEnum.Manage); bool HasManageRight = new PositionRightBLL().CheckPositionRight(position.PositionId, opViewId); this.divBudgetInfo.Visible = HasManageRight; this.divBudgetInfoTitle.Visible = HasManageRight; //流程控件赋值 this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"]; this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString(); this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"]; }
public bool insertCustomer(string name, string add, string ph, string aadhar) { objCustomer = new CustomerTableAdapter(); return(objCustomer.InsertCustomer(name, add, ph, aadhar) > 0); }
protected void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); if (!this.IsPostBack) { String title = this.GetLocalResourceObject("titleLabel.Text").ToString(); PageUtility.SetContentTitle(this.Page, title); MasterDataBLL mdBLL = new MasterDataBLL(); int formID = int.Parse(Request["ObjectId"]); this.ViewState["ObjectId"] = formID; FormDS.FormSalePaymentRow rowFormPayment = this.FormSaleBLL.GetFormSalePaymentByID(int.Parse(this.ViewState["ObjectId"].ToString())); FormDS.FormRow rowForm = this.FormSaleBLL.GetFormByID(formID)[0]; if (rowForm.IsProcIDNull()) { ViewState["ProcID"] = ""; } else { ViewState["ProcID"] = rowForm.ProcID; } this.FormNoCtl.Text = rowForm.FormNo; AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID); this.StuffNameCtl.Text = CommonUtility.GetStaffFullName(applicant); this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName; if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null) { this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName; } this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString(); this.ApplyFormNoCtl.Text = this.FormSaleBLL.GetFormByID(rowFormPayment.FormSaleApplyID)[0].FormNo; FormDS.FormSaleApplyRow rowFormApply = this.FormSaleBLL.GetFormSaleApplyByID(rowFormPayment.FormSaleApplyID)[0]; this.PeriodCtl.Text = rowFormApply.FPeriod.ToString("yyyy-MM"); MasterData.CustomerRow customer = new CustomerTableAdapter().GetDataByID(rowFormApply.CustomerID)[0]; this.CustomerNameCtl.Text = customer.CustomerName; this.CustomerChannelCtl.Text = new CustomerChannelTableAdapter().GetDataByID(customer.CustomerChannelID)[0].CustomerChannelName; this.KATypeCtl.Text = customer.IsKaTypeNull() ? "" : customer.KaType; this.CustomerRegionCtl.Text = new CustomerRegionTableAdapter().GetDataByID(customer.CustomerRegionID)[0].CustomerRegionName; this.CityCtl.Text = customer.City; this.BrandCtl.Text = new BrandTableAdapter().GetDataByID(rowFormApply.BrandID)[0].BrandName; MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = mdBLL.GetExpenseSubCategoryById(rowFormApply.ExpenseSubCategoryID); this.ExpenseCategoryCtl.Text = mdBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID).ExpenseCategoryName; this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName; this.CurrencyCtl.Text = new CurrencyTableAdapter().GetDataByID(rowFormApply.CurrencyID)[0].CurrencyShortName; this.ExchangeRateCtl.Text = rowFormApply.ExchangeRate.ToString(); this.ShopNameCtl.Text = rowFormApply.IsShopNameNull() ? "" : rowFormApply.ShopName; this.ShopCountCtl.Text = rowFormApply.IsShopCountNull() ? "" : rowFormApply.ShopCount.ToString(); this.ProjectNameCtl.Text = rowFormApply.IsProjectNameNull() ? "" : rowFormApply.ProjectName; this.CostCenterCtl.Text = CommonUtility.GetMAACostCenterFullName(rowForm.CostCenterID); this.ProjectDescCtl.Text = rowFormApply.IsProjectDescNull() ? "" : rowFormApply.ProjectDesc; if (!rowFormApply.IsApplyFileNameNull()) this.UCFileUpload.AttachmentFileName = rowFormApply.ApplyFileName; if (!rowFormApply.IsApplyRealFileNameNull()) this.UCFileUpload.RealAttachmentFileName = rowFormApply.ApplyRealFileName; if (!rowFormPayment.IsRemarkNull()) { this.RemarkCtl.Text = rowFormPayment.Remark; } if (!rowFormPayment.IsAttachedFileNameNull()) { this.UCPaymentFile.AttachmentFileName = rowFormPayment.AttachedFileName; } if (!rowFormPayment.IsRealAttachedFileNameNull()) { this.UCPaymentFile.RealAttachmentFileName = rowFormPayment.RealAttachedFileName; } this.PaymentTypeCtl.Text = new MasterDataBLL().GetPaymentTypeById(rowFormPayment.PaymentTypeID).PaymentTypeName; this.InvoiceStatusCtl.Text = new InvoiceStatusTableAdapter().GetDataByID(rowFormPayment.InvoiceStatusID)[0].Name; if (!rowFormPayment.IsVendorIDNull()) { MasterData.VendorRow vendor = new MasterDataBLL().GetVendorByID(rowFormPayment.VendorID); this.VendorCtl.Text = vendor.VendorName + "-" + vendor.VendorCode; } this.txtVatType.Text = mdBLL.GetVatTypeById(rowFormPayment.VatTypeID)[0].VatTypeName; //历史单据 if (rowForm.IsRejectedFormIDNull()) { lblRejectFormNo.Text = "无"; } else { FormDS.FormRow rejectedForm = this.FormSaleBLL.GetFormByID(rowForm.RejectedFormID)[0]; this.lblRejectFormNo.Text = rejectedForm.FormNo; this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/FormSale/ActivityAdvancedPaymentApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')"; } //促销信息 this.DisplayTypeCtl.Text = mdBLL.GetDisplayTypeById(rowFormApply.DisplayTypeID).DisplayTypeName; this.DisplayAreaCtl.Text = rowFormApply.IsDisplayAreaNull() ? "" : rowFormApply.DisplayArea.ToString(); this.IsDMCtl.Text = rowFormApply.IsDM ? "Yes" : "No"; this.DiscountTypeCtl.Text = mdBLL.GetDiscountTypeById(rowFormApply.DiscountTypeID).DiscountTypeName; if (!rowFormApply.IsActivityBeginDateNull()) { this.ActivityBeginCtl.Text = rowFormApply.ActivityBeginDate.ToString("yyyy-MM-dd"); } if (!rowFormApply.IsActivityEndDateNull()) { this.ActivityEndCtl.Text = rowFormApply.ActivityEndDate.ToString("yyyy-MM-dd"); } if (!rowFormApply.IsDeliveryBeginDateNull()) { this.DeliveryBeginCtl.Text = rowFormApply.DeliveryBeginDate.ToString("yyyy-MM-dd"); } if (!rowFormApply.IsDeliveryEndDateNull()) { this.DeliveryEndCtl.Text = rowFormApply.DeliveryEndDate.ToString("yyyy-MM-dd"); } //明细 this.odsInvoice.SelectParameters["FormID"].DefaultValue = rowFormPayment.FormSalePaymentID.ToString(); this.odsSKUDetails.SelectParameters["FormSaleApplyID"].DefaultValue = rowFormPayment.FormSaleApplyID.ToString(); this.odsPaymentDetails.SelectParameters["FormSalePaymentID"].DefaultValue = rowFormPayment.FormSalePaymentID.ToString(); //审批页面处理&按钮处理 AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"]; this.ViewState["StuffUserID"] = stuffUser.StuffUserId; if (rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P")) { this.SubmitBtn.Visible = true; this.cwfAppCheck.IsView = false; this.ViewState["IsView"] = false; } else { this.SubmitBtn.Visible = false; this.cwfAppCheck.IsView = true; this.ViewState["IsView"] = true; } if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && stuffUser.StuffUserId == rowForm.UserID) { this.EditBtn.Visible = true; this.ScrapBtn.Visible = true; } else { this.EditBtn.Visible = false; this.ScrapBtn.Visible = false; } //如果是弹出,取消按钮不可见 if (this.Request["ShowDialog"] != null) { if (this.Request["ShowDialog"].ToString() == "1") { this.upButton.Visible = false; this.Master.FindControl("divMenu").Visible = false; this.Master.FindControl("tbCurrentPage").Visible = false; } } //判断财务摘要的显示问题 if (!rowForm.IsFinanceRemarkNull()) { this.FinanceRemarkCtl.Text = rowForm.FinanceRemark; } int opViewId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.FinanceRemark, SystemEnums.OperateEnum.View); int opManageId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.FinanceRemark, SystemEnums.OperateEnum.Manage); AuthorizationDS.PositionRow ViewerPosition = (AuthorizationDS.PositionRow)this.Session["Position"]; PositionRightBLL positionRightBLL = new PositionRightBLL(); bool HasViewRight = positionRightBLL.CheckPositionRight(ViewerPosition.PositionId, opViewId); bool HasManageRight = positionRightBLL.CheckPositionRight(ViewerPosition.PositionId, opManageId); //如果没有权限则隐藏 if (!HasViewRight && !HasManageRight) { this.FinanceRemarkTitleDIV.Visible = false; this.FinanceRemarkDIV.Visible = false; this.SaveBtn.Visible = false; } //如果没有填写的权限或者已经填写了,则隐藏保存按钮 if (HasViewRight && (!HasManageRight || !rowForm.IsFinanceRemarkNull())) { this.FinanceRemarkCtl.ReadOnly = true; this.SaveBtn.Visible = false; } //如果不是审批中或者审批完成不能修改 if (rowForm.StatusID != 1 && rowForm.StatusID != 2) { this.FinanceRemarkCtl.ReadOnly = true; this.SaveBtn.Visible = false; } } this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"]; this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString(); this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"]; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request["q"] != null) { if (Session["Login"].ToString() != null) { Session["Login"] = null; Session["Name"] = null; Response.Redirect(ConfigurationManager.AppSettings.GetValues("mainURL") + "signin.aspx"); } } UserProfileTableAdapter userProfileTableAdapter = new UserProfileTableAdapter(); UserProfile userProfile = userProfileTableAdapter.GetUserProfileByID(Convert.ToInt32(Session["Login"])); DataTable dtUserProfile = userProfileTableAdapter.GetDataByStatus("ACTIVE"); if (userProfile.DepartmentID == 1) { if (userProfile.UserRoleID == 1) { ltlCustomer.Visible = true; ltlDepartmentView.Visible = true; ltlInvoiceReportView.Visible = true; ltlUserProfileView.Visible = true; ltlUserRoleView.Visible = true; ltlRiver.Visible = true; ltlRiverView.Visible = true; //chartWaterLevel.Visible = true; //string[] x = new string[dtWaterLevel.Rows.Count]; //int[] y = new int[dtWaterLevel.Rows.Count]; //for (int i = 0; i < dtWaterLevel.Rows.Count; i++) //{ // x[i] = dtWaterLevel.Rows[i][2].ToString(); // y[i] = Convert.ToInt32(dtWaterLevel.Rows[i][0]); //} //chartWaterLevel.Series[0].Points.DataBindXY(x, y); //chartWaterLevel.Series[0].ChartType = SeriesChartType.Column; //chartWaterLevel.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true; //chartWaterLevel.Legends[0].Enabled = true; } } else if (userProfile.DepartmentID == 2) { if (userProfile.UserRoleID == 2) { ltlCustomerView.Visible = true; ltlDepartmentView.Visible = true; ltlUserProfileView.Visible = true; ltlUserRoleView.Visible = true; } else if (userProfile.UserRoleID == 3) { ltlCustomerView.Visible = true; ltlDepartmentView.Visible = false; ltlInvoiceReportView.Visible = true; ltlUserProfileView.Visible = false; ltlUserRoleView.Visible = false; } } else if (userProfile.DepartmentID == 3) { if (userProfile.UserRoleID == 4) { ltlCustomerView.Visible = false; ltlDepartmentView.Visible = false; ltlUserProfileView.Visible = false; ltlUserRoleView.Visible = false; } } else if (userProfile.DepartmentID == 4) { if (userProfile.UserRoleID == 5 || userProfile.UserRoleID == 6) { ltlCustomerView.Visible = false; ltlDepartmentView.Visible = false; ltlInvoiceReportView.Visible = false; ltlUserProfileView.Visible = false; ltlUserRoleView.Visible = false; } } else if (userProfile.DepartmentID == 5) { if (userProfile.UserRoleID == 7) { ltlCustomerView.Visible = true; ltlDepartmentView.Visible = false; ltlInvoiceReportView.Visible = false; ltlUserProfileView.Visible = false; ltlUserRoleView.Visible = false; } } else if (userProfile.DepartmentID == 6) { if (userProfile.UserRoleID == 8) { ltlCustomerView.Visible = false; ltlDepartmentView.Visible = false; ltlInvoiceReportView.Visible = false; ltlUserProfileView.Visible = false; ltlUserRoleView.Visible = false; } } DataTable dtUserProfileList = userProfileTableAdapter.GetDataByStatus("ACTIVE"); ltlUser.Text = dtUserProfileList.Rows.Count.ToString(); CustomerTableAdapter customeTableAdapter = new CustomerTableAdapter(); DataTable dtCustomerList = customeTableAdapter.GetDataByStatus("ACTIVE"); ltlCustomer.Text = dtCustomerList.Rows.Count.ToString(); ProjectTableAdapter projectTableAdapter = new ProjectTableAdapter(); DataTable dtProjectList = projectTableAdapter.GetDataByStatus("ACTIVE"); DepartmentTableAdapter departmentTableAdapter = new DepartmentTableAdapter(); DataTable dtDepartmentList = departmentTableAdapter.GetDataByStatus("ACTIVE"); ltlDepartment.Text = dtDepartmentList.Rows.Count.ToString(); UserRoleTableAdapter userRoleTableAdapter = new UserRoleTableAdapter(); DataTable dtUserRole = userRoleTableAdapter.GetDataByStatus("ACTIVE"); ltlUserRole.Text = dtUserRole.Rows.Count.ToString(); WaterLevelTableAdapter waterLevelTabeleAdapter = new WaterLevelTableAdapter(); DataTable dtWaterLevel = waterLevelTabeleAdapter.GetDataByStatus("ACTIVE"); ltlWaterLevel.Text = dtWaterLevel.Rows.Count.ToString(); RiverTableAdapter riverTableAdapter = new RiverTableAdapter(); DataTable dtRiver = riverTableAdapter.GetDataByStatus("ACTIVE"); ltlRiver.Text = dtRiver.Rows.Count.ToString(); DamTableAdapter damTableAdapter = new DamTableAdapter(); DataTable dtDam = damTableAdapter.GetDataByStatus("ACTIVE"); ltlDam.Text = dtDam.Rows.Count.ToString(); WaterLevelDamTableAdapter waterLevelDamTabeleAdapter = new WaterLevelDamTableAdapter(); DataTable dtWaterLevelDam = waterLevelDamTabeleAdapter.GetDataByStatus("ACTIVE"); ltlWaterLevelDam.Text = dtWaterLevelDam.Rows.Count.ToString(); } }
public DataTable getCustomer() { objCustomer = new CustomerTableAdapter(); return(objCustomer.GetCustomer()); }
public void SaveDataToDB(string FullPath, string FileName, string excelFileExtension) { SqlTransaction transaction = null; try { DataTable dt = null; dt = this.GetDataSet(FullPath, excelFileExtension).Tables[0]; if (dt.Rows.Count <= 1) { PageUtility.ShowModelDlg(this.Page, "�ļ���û���κμ�¼��������ѡ��"); return; } CustomerTableAdapter TACustomer = new CustomerTableAdapter(); ImportLogTableAdapter TAImportLog = new ImportLogTableAdapter(); ImportLogDetailTableAdapter TAImportLogDetail = new ImportLogDetailTableAdapter(); MasterDataBLL mdBLL = new MasterDataBLL(); transaction = TableAdapterHelper.BeginTransaction(TACustomer); TableAdapterHelper.SetTransaction(TAImportLog, transaction); TableAdapterHelper.SetTransaction(TAImportLogDetail, transaction); //�洢log��Ϣ ImportDS.ImportLogDataTable logTable = new ImportDS.ImportLogDataTable(); ImportDS.ImportLogRow logRow = logTable.NewImportLogRow(); int stuffUserID = ((AuthorizationDS.StuffUserRow)Session["StuffUser"]).StuffUserId; string fullname = this.fileUpLoad.PostedFile.FileName.ToString(); string tmpFile = fullname.Remove(0, fullname.LastIndexOf("\\") + 1); logRow.FileName = tmpFile; logRow.ImportDate = DateTime.Now; logRow.ImportUserID = stuffUserID; logRow.ImportType = 3; logRow.TotalCount = dt.Rows.Count - 1; logRow.SuccessCount = dt.Rows.Count - 1; logRow.FailCount = 0; logTable.AddImportLogRow(logRow); TAImportLog.Update(logTable); //����ÿ����ϸ ERS.CustomerDataTable tbCustomer = new ERS.CustomerDataTable(); ImportDS.ImportLogDetailDataTable ImportLogDetailTable = new ImportDS.ImportLogDetailDataTable(); int row_count = dt.Rows.Count; string errorInfor = string.Empty; // int expenseTypeID = int.Parse(ExpenseTypeDDL.SelectedValue); //��ʼ����ÿ����ϸ for (int i = 1; i <= row_count - 1; i++) { if (CheckData(dt.Rows[i]) != null) { errorInfor = "��" + (i + 1) + "���д��" + CheckData(dt.Rows[i]); ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } else { DataRow row = dt.Rows[i]; string CustomerNo = row[0].ToString().Trim(); string CustomerName = row[1].ToString().Trim(); string ProvinceName = row[2].ToString().Trim(); string CityName = row[3].ToString().Trim(); string CustomerTypeName = row[4].ToString().Trim(); string ChannelTypeName = row[5].ToString().Trim(); string OUName = row[6].ToString().Trim(); string BudgetOUName = row[7].ToString().Trim(); ERS.CustomerDataTable tbCustomerTemp = mdBLL.GetCustomerByCustomerName(CustomerName); if (tbCustomerTemp != null && tbCustomerTemp.Count > 0) { errorInfor = "��" + (i + 1) + "���д���Ѵ��ڿͻ���" + CustomerName + "��"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } //ERS.ProvinceDataTable tbProvince = mdBLL.GetProvinceByProvinceName(ProvinceName); //if (tbProvince == null || tbProvince.Count == 0) { // errorInfor = "��" + (i + 1) + "���д���Ҳ���ʡ�ݡ�" + ProvinceName + "��"; // ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); // ImportDetailRow.LogID = logRow.LogID; // ImportDetailRow.Line = i + 1; // ImportDetailRow.Error = errorInfor; // ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); // logRow.FailCount = logRow.FailCount + 1; // logRow.SuccessCount = logRow.SuccessCount - 1; // TAImportLog.Update(logRow); // continue; //} ERS.CityDataTable tbCity = mdBLL.GetCityByCityName(CityName); if (tbCity == null || tbCity.Count == 0) { errorInfor = "��" + (i + 1) + "���д���Ҳ������С�" + CityName + "��"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } ERS.CustomerTypeDataTable tbCustomerType = mdBLL.GetCustomerTypeByCustomerTypeName(CustomerTypeName); if (tbCustomerType == null || tbCustomerType.Count == 0) { errorInfor = "��" + (i + 1) + "���д���Ҳ����ͻ����͡�" + CustomerTypeName + "��"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } ERS.ChannelTypeDataTable tbChannelType = mdBLL.GetChannelTypeByChannelTypeName(ChannelTypeName); if (tbChannelType == null || tbChannelType.Count == 0) { errorInfor = "��" + (i + 1) + "���д���Ҳ����ͻ�������" + ChannelTypeName + "��"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } AuthorizationDS.OrganizationUnitDataTable ouTable = new OUTreeBLL().GetDataByOrganizationUnitName(OUName); if (ouTable == null || ouTable.Count == 0) { errorInfor = "��" + (i + 1) + "���д��ϵͳ���Ҳ����˲��š�" + OUName + "��"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } if (ouTable.Count > 1) { errorInfor = "��" + (i + 1) + "���д��ϵͳ���ҵ���������ƵIJ��š�" + OUName + "��"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } AuthorizationDS.OrganizationUnitDataTable BudgetOUTable = new OUTreeBLL().GetDataByOrganizationUnitName(BudgetOUName); if (BudgetOUTable == null || BudgetOUTable.Count == 0) { errorInfor = "��" + (i + 1) + "���д��ϵͳ���Ҳ����˲��š�" + BudgetOUName + "��"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } if (BudgetOUTable.Count > 1) { errorInfor = "��" + (i + 1) + "���д��ϵͳ���ҵ���������ƵIJ��š�" + BudgetOUName + "��"; ImportDS.ImportLogDetailRow ImportDetailRow = ImportLogDetailTable.NewImportLogDetailRow(); ImportDetailRow.LogID = logRow.LogID; ImportDetailRow.Line = i + 1; ImportDetailRow.Error = errorInfor; ImportLogDetailTable.AddImportLogDetailRow(ImportDetailRow); logRow.FailCount = logRow.FailCount + 1; logRow.SuccessCount = logRow.SuccessCount - 1; TAImportLog.Update(logRow); continue; } ERS.CustomerRow rowCustomer = tbCustomer.NewCustomerRow(); rowCustomer.CustomerNo = CustomerNo; rowCustomer.CustomerName = CustomerName; rowCustomer.CityID = tbCity[0].CityID; rowCustomer.CustomerTypeID = tbCustomerType[0].CustomerTypeID; rowCustomer.ChannelTypeID = tbChannelType[0].ChannelTypeID; rowCustomer.OrganizationUnitID = ouTable[0].OrganizationUnitId; rowCustomer.ApplyOrganizationUnitID = BudgetOUTable[0].OrganizationUnitId; rowCustomer.IsActive = true; tbCustomer.AddCustomerRow(rowCustomer); TACustomer.Update(rowCustomer); } } TAImportLog.Update(logRow); TAImportLogDetail.Update(ImportLogDetailTable); transaction.Commit(); string returnString = "�ɹ�����" + logRow.SuccessCount.ToString() + "����Ϣ"; PageUtility.ShowModelDlg(this.Page, returnString); } catch (Exception ex) { if (transaction != null) { transaction.Rollback(); } PageUtility.ShowModelDlg(this.Page, "Save Fail!" + ex.ToString()); } finally { if (transaction != null) { transaction.Dispose(); } } }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InvoiceSaleForm)); this.lstTotal = new System.Windows.Forms.ListView(); this.ItemID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.ItemName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.SellPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.Count = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.Total = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.btnCreateInvoice = new System.Windows.Forms.Button(); this.btnDeleteInvoiceItem = new System.Windows.Forms.Button(); this.cmbCustomers = new System.Windows.Forms.ComboBox(); this.customerBindingSource = new System.Windows.Forms.BindingSource(this.components); this.storeDBDataSet = new Store.DB.StoreDBDataSet(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.numExpenses = new System.Windows.Forms.NumericUpDown(); this.numDiscount = new System.Windows.Forms.NumericUpDown(); this.chkUnPaidInvoice = new System.Windows.Forms.CheckBox(); this.label4 = new System.Windows.Forms.Label(); this.cmbBankAccount = new System.Windows.Forms.ComboBox(); this.bankAccountBindingSource = new System.Windows.Forms.BindingSource(this.components); this.lblDiscount = new System.Windows.Forms.Label(); this.rdbtnChequePayment = new System.Windows.Forms.RadioButton(); this.rdbtnPosPayment = new System.Windows.Forms.RadioButton(); this.rdbtnCashPayment = new System.Windows.Forms.RadioButton(); this.bankAccountTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.BankAccountTableAdapter(); this.customerTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.CustomerTableAdapter(); this.lstItems = new System.Windows.Forms.ListView(); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.label11 = new System.Windows.Forms.Label(); this.txtItemNameID = new System.Windows.Forms.TextBox(); this.btnAddToInvoice = new System.Windows.Forms.Button(); this.chkReportOutput = new System.Windows.Forms.CheckBox(); this.stiReport1 = new Stimulsoft.Report.StiReport(); this.stiReportDataSource10 = new Stimulsoft.Report.Design.StiReportDataSource("StoreDBDataSet", this.storeDBDataSet); this.viewCustomerOnInvoiceTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.ViewCustomerOnInvoiceTableAdapter(); this.dailyTransactionTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.DailyTransactionTableAdapter(); this.abrInvoiceDate = new AbrAfzarGostaran.Windows.Forms.AbrPersianDatePicker(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.btnAddCustomer = new System.Windows.Forms.Button(); this.btnSeparateInvoices = new System.Windows.Forms.Button(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.listTimer = new System.Windows.Forms.Timer(this.components); this.itemTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.ItemTableAdapter(); this.invoiceTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.InvoiceTableAdapter(); this.invoiceItemTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.InvoiceItemTableAdapter(); this.chkChangeTextForID = new System.Windows.Forms.CheckBox(); this.lblTimestamp = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.lblTotalPrice = new System.Windows.Forms.Label(); this.lblTotalPayable = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.customerBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.storeDBDataSet)).BeginInit(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numExpenses)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numDiscount)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bankAccountBindingSource)).BeginInit(); this.SuspendLayout(); // // lstTotal // this.lstTotal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.lstTotal.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.ItemID, this.ItemName, this.SellPrice, this.Count, this.Total}); this.lstTotal.Font = new System.Drawing.Font("XB Roya", 11F); this.lstTotal.FullRowSelect = true; this.lstTotal.GridLines = true; this.lstTotal.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.lstTotal.Location = new System.Drawing.Point(348, 67); this.lstTotal.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.lstTotal.Name = "lstTotal"; this.lstTotal.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.lstTotal.RightToLeftLayout = true; this.lstTotal.ShowGroups = false; this.lstTotal.Size = new System.Drawing.Size(506, 545); this.lstTotal.TabIndex = 10; this.lstTotal.UseCompatibleStateImageBehavior = false; this.lstTotal.View = System.Windows.Forms.View.Details; this.lstTotal.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lstTotal_ColumnClick); this.lstTotal.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lstTotal_KeyDown); // // ItemID // this.ItemID.Text = "کد کالا"; this.ItemID.Width = 90; // // ItemName // this.ItemName.Text = "نام"; this.ItemName.Width = 120; // // SellPrice // this.SellPrice.Text = "فی واحد"; this.SellPrice.Width = 59; // // Count // this.Count.Text = "تعداد"; this.Count.Width = 44; // // Total // this.Total.Text = "فی کل"; this.Total.Width = 90; // // btnCreateInvoice // this.btnCreateInvoice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCreateInvoice.Location = new System.Drawing.Point(217, 574); this.btnCreateInvoice.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnCreateInvoice.Name = "btnCreateInvoice"; this.btnCreateInvoice.Size = new System.Drawing.Size(124, 39); this.btnCreateInvoice.TabIndex = 9; this.btnCreateInvoice.Text = "&صدور فاکتور"; this.btnCreateInvoice.UseVisualStyleBackColor = true; this.btnCreateInvoice.Click += new System.EventHandler(this.btnCreateInvoice_Click); // // btnDeleteInvoiceItem // this.btnDeleteInvoiceItem.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnDeleteInvoiceItem.Image = global::Store.Properties.Resources.cancel; this.btnDeleteInvoiceItem.Location = new System.Drawing.Point(817, 18); this.btnDeleteInvoiceItem.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnDeleteInvoiceItem.Name = "btnDeleteInvoiceItem"; this.btnDeleteInvoiceItem.Size = new System.Drawing.Size(37, 47); this.btnDeleteInvoiceItem.TabIndex = 11; this.btnDeleteInvoiceItem.UseVisualStyleBackColor = true; this.btnDeleteInvoiceItem.Click += new System.EventHandler(this.btnDeleteInvoiceItem_Click); // // cmbCustomers // this.cmbCustomers.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.cmbCustomers.DataSource = this.customerBindingSource; this.cmbCustomers.DisplayMember = "Name"; this.cmbCustomers.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCustomers.FormattingEnabled = true; this.cmbCustomers.Location = new System.Drawing.Point(77, 63); this.cmbCustomers.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.cmbCustomers.Name = "cmbCustomers"; this.cmbCustomers.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.cmbCustomers.Size = new System.Drawing.Size(193, 27); this.cmbCustomers.TabIndex = 2; this.cmbCustomers.ValueMember = "ID"; this.cmbCustomers.SelectedIndexChanged += new System.EventHandler(this.cmbCustomers_SelectedIndexChanged); // // customerBindingSource // this.customerBindingSource.DataMember = "Customer"; this.customerBindingSource.DataSource = this.storeDBDataSet; // // storeDBDataSet // this.storeDBDataSet.DataSetName = "StoreDBDataSet"; this.storeDBDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBox1.Controls.Add(this.label6); this.groupBox1.Controls.Add(this.lblTotalPayable); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.lblTotalPrice); this.groupBox1.Controls.Add(this.numExpenses); this.groupBox1.Controls.Add(this.numDiscount); this.groupBox1.Controls.Add(this.chkUnPaidInvoice); this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.cmbBankAccount); this.groupBox1.Controls.Add(this.lblDiscount); this.groupBox1.Controls.Add(this.rdbtnChequePayment); this.groupBox1.Controls.Add(this.rdbtnPosPayment); this.groupBox1.Controls.Add(this.rdbtnCashPayment); this.groupBox1.Location = new System.Drawing.Point(9, 107); this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBox1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.groupBox1.Size = new System.Drawing.Size(331, 380); this.groupBox1.TabIndex = 5; this.groupBox1.TabStop = false; this.groupBox1.Text = "پرداخت"; // // numExpenses // this.numExpenses.Font = new System.Drawing.Font("XB Roya", 10.25F); this.numExpenses.Increment = new decimal(new int[] { 500, 0, 0, 0}); this.numExpenses.Location = new System.Drawing.Point(59, 245); this.numExpenses.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.numExpenses.Maximum = new decimal(new int[] { -469762049, -590869294, 5421010, 0}); this.numExpenses.Name = "numExpenses"; this.numExpenses.Size = new System.Drawing.Size(149, 29); this.numExpenses.TabIndex = 0; this.numExpenses.ThousandsSeparator = true; this.numExpenses.ValueChanged += new System.EventHandler(this.numExpenses_ValueChanged); // // numDiscount // this.numDiscount.Font = new System.Drawing.Font("XB Roya", 10.25F); this.numDiscount.Increment = new decimal(new int[] { 500, 0, 0, 0}); this.numDiscount.Location = new System.Drawing.Point(59, 208); this.numDiscount.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.numDiscount.Maximum = new decimal(new int[] { -469762049, -590869294, 5421010, 0}); this.numDiscount.Name = "numDiscount"; this.numDiscount.Size = new System.Drawing.Size(149, 29); this.numDiscount.TabIndex = 0; this.numDiscount.ThousandsSeparator = true; this.numDiscount.ValueChanged += new System.EventHandler(this.numDiscount_ValueChanged); // // chkUnPaidInvoice // this.chkUnPaidInvoice.AutoSize = true; this.chkUnPaidInvoice.Enabled = false; this.chkUnPaidInvoice.Location = new System.Drawing.Point(225, 28); this.chkUnPaidInvoice.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.chkUnPaidInvoice.Name = "chkUnPaidInvoice"; this.chkUnPaidInvoice.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.chkUnPaidInvoice.Size = new System.Drawing.Size(97, 24); this.chkUnPaidInvoice.TabIndex = 3; this.chkUnPaidInvoice.Text = "پرداخت نشده"; this.chkUnPaidInvoice.UseVisualStyleBackColor = true; this.chkUnPaidInvoice.CheckedChanged += new System.EventHandler(this.chkUnPaidInvoice_CheckedChanged); // // label4 // this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(243, 249); this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label4.Name = "label4"; this.label4.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label4.Size = new System.Drawing.Size(78, 20); this.label4.TabIndex = 21; this.label4.Text = "اضافه دریافت"; // // cmbBankAccount // this.cmbBankAccount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.cmbBankAccount.DataSource = this.bankAccountBindingSource; this.cmbBankAccount.DisplayMember = "NumberName"; this.cmbBankAccount.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbBankAccount.Enabled = false; this.cmbBankAccount.FormattingEnabled = true; this.cmbBankAccount.Location = new System.Drawing.Point(51, 94); this.cmbBankAccount.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.cmbBankAccount.Name = "cmbBankAccount"; this.cmbBankAccount.Size = new System.Drawing.Size(186, 27); this.cmbBankAccount.TabIndex = 2; this.cmbBankAccount.ValueMember = "ID"; // // bankAccountBindingSource // this.bankAccountBindingSource.DataMember = "BankAccount"; this.bankAccountBindingSource.DataSource = this.storeDBDataSet; // // lblDiscount // this.lblDiscount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lblDiscount.AutoSize = true; this.lblDiscount.Location = new System.Drawing.Point(277, 212); this.lblDiscount.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.lblDiscount.Name = "lblDiscount"; this.lblDiscount.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.lblDiscount.Size = new System.Drawing.Size(43, 20); this.lblDiscount.TabIndex = 21; this.lblDiscount.Text = "تخفیف"; // // rdbtnChequePayment // this.rdbtnChequePayment.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.rdbtnChequePayment.AutoSize = true; this.rdbtnChequePayment.Enabled = false; this.rdbtnChequePayment.Location = new System.Drawing.Point(276, 129); this.rdbtnChequePayment.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.rdbtnChequePayment.Name = "rdbtnChequePayment"; this.rdbtnChequePayment.Size = new System.Drawing.Size(48, 24); this.rdbtnChequePayment.TabIndex = 3; this.rdbtnChequePayment.Text = "چک"; this.rdbtnChequePayment.UseVisualStyleBackColor = true; // // rdbtnPosPayment // this.rdbtnPosPayment.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.rdbtnPosPayment.AutoSize = true; this.rdbtnPosPayment.Enabled = false; this.rdbtnPosPayment.Location = new System.Drawing.Point(252, 95); this.rdbtnPosPayment.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.rdbtnPosPayment.Name = "rdbtnPosPayment"; this.rdbtnPosPayment.Size = new System.Drawing.Size(72, 24); this.rdbtnPosPayment.TabIndex = 1; this.rdbtnPosPayment.Text = "&کارتخوان"; this.rdbtnPosPayment.UseVisualStyleBackColor = true; this.rdbtnPosPayment.CheckedChanged += new System.EventHandler(this.rdbtnPosPayment_CheckedChanged); this.rdbtnPosPayment.EnabledChanged += new System.EventHandler(this.rdbtnPosPayment_EnabledChanged); // // rdbtnCashPayment // this.rdbtnCashPayment.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.rdbtnCashPayment.AutoSize = true; this.rdbtnCashPayment.Checked = true; this.rdbtnCashPayment.Location = new System.Drawing.Point(281, 61); this.rdbtnCashPayment.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.rdbtnCashPayment.Name = "rdbtnCashPayment"; this.rdbtnCashPayment.Size = new System.Drawing.Size(43, 24); this.rdbtnCashPayment.TabIndex = 0; this.rdbtnCashPayment.TabStop = true; this.rdbtnCashPayment.Text = "ن&قد"; this.rdbtnCashPayment.UseVisualStyleBackColor = true; // // bankAccountTableAdapter // this.bankAccountTableAdapter.ClearBeforeFill = true; // // customerTableAdapter // this.customerTableAdapter.ClearBeforeFill = true; // // lstItems // this.lstItems.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.lstItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, this.columnHeader2, this.columnHeader5, this.columnHeader3}); this.lstItems.Font = new System.Drawing.Font("XB Roya", 11F); this.lstItems.FullRowSelect = true; this.lstItems.GridLines = true; this.lstItems.Location = new System.Drawing.Point(862, 67); this.lstItems.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.lstItems.MultiSelect = false; this.lstItems.Name = "lstItems"; this.lstItems.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.lstItems.RightToLeftLayout = true; this.lstItems.ShowGroups = false; this.lstItems.Size = new System.Drawing.Size(488, 545); this.lstItems.TabIndex = 1; this.lstItems.UseCompatibleStateImageBehavior = false; this.lstItems.View = System.Windows.Forms.View.Details; this.lstItems.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lstItem_ColumnClick); this.lstItems.DoubleClick += new System.EventHandler(this.lstItems_DoubleClick); this.lstItems.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lstItems_KeyDown); this.lstItems.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.lstItems_KeyPress); // // columnHeader1 // this.columnHeader1.Text = "کد کالا"; this.columnHeader1.Width = 130; // // columnHeader2 // this.columnHeader2.Text = "نام کالا"; this.columnHeader2.Width = 180; // // columnHeader5 // this.columnHeader5.Text = "موجودی"; // // columnHeader3 // this.columnHeader3.Text = "قیمت فروش"; this.columnHeader3.Width = 90; // // label11 // this.label11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(1297, 39); this.label11.Name = "label11"; this.label11.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label11.Size = new System.Drawing.Size(58, 20); this.label11.TabIndex = 31; this.label11.Text = "نام یا کد:"; // // txtItemNameID // this.txtItemNameID.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtItemNameID.Location = new System.Drawing.Point(1018, 35); this.txtItemNameID.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtItemNameID.Name = "txtItemNameID"; this.txtItemNameID.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtItemNameID.Size = new System.Drawing.Size(271, 27); this.txtItemNameID.TabIndex = 0; this.txtItemNameID.TextChanged += new System.EventHandler(this.txtItemNameID_TextChanged); this.txtItemNameID.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtItemNameID_KeyDown); this.txtItemNameID.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtItemNameID_KeyPress); // // btnAddToInvoice // this.btnAddToInvoice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnAddToInvoice.Image = global::Store.Properties.Resources.leftarrow; this.btnAddToInvoice.Location = new System.Drawing.Point(862, 18); this.btnAddToInvoice.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnAddToInvoice.Name = "btnAddToInvoice"; this.btnAddToInvoice.Size = new System.Drawing.Size(37, 47); this.btnAddToInvoice.TabIndex = 3; this.btnAddToInvoice.UseVisualStyleBackColor = true; this.btnAddToInvoice.Click += new System.EventHandler(this.btnAddToInvoice_Click); // // chkReportOutput // this.chkReportOutput.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.chkReportOutput.AutoSize = true; this.chkReportOutput.Location = new System.Drawing.Point(109, 584); this.chkReportOutput.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.chkReportOutput.Name = "chkReportOutput"; this.chkReportOutput.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.chkReportOutput.Size = new System.Drawing.Size(101, 24); this.chkReportOutput.TabIndex = 32; this.chkReportOutput.Text = "گزارش (چاپ)"; this.chkReportOutput.UseVisualStyleBackColor = true; // // stiReport1 // this.stiReport1.EngineVersion = Stimulsoft.Report.Engine.StiEngineVersion.EngineV2; this.stiReport1.ReferencedAssemblies = new string[] { "System.Dll", "System.Drawing.Dll", "Dll", "System.Data.Dll", "System.Xml.Dll", "Stimulsoft.Controls.Dll", "Stimulsoft.Base.Dll", "Stimulsoft.Report.Dll"}; this.stiReport1.ReportAlias = "Report"; this.stiReport1.ReportDataSources.Add(this.stiReportDataSource10); this.stiReport1.ReportGuid = "2eb0fd0f635b4feeaa3c92aa921c77ff"; this.stiReport1.ReportName = "Report"; this.stiReport1.ReportSource = resources.GetString("stiReport1.ReportSource"); this.stiReport1.ReportUnit = Stimulsoft.Report.StiReportUnitType.Millimeters; this.stiReport1.ScriptLanguage = Stimulsoft.Report.StiReportLanguageType.CSharp; this.stiReport1.UseProgressInThread = false; // // stiReportDataSource10 // this.stiReportDataSource10.Item = this.storeDBDataSet; this.stiReportDataSource10.Name = "StoreDBDataSet"; // // viewCustomerOnInvoiceTableAdapter // this.viewCustomerOnInvoiceTableAdapter.ClearBeforeFill = true; // // dailyTransactionTableAdapter // this.dailyTransactionTableAdapter.ClearBeforeFill = true; // // abrInvoiceDate // this.abrInvoiceDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.abrInvoiceDate.EndOfYears = 1900; this.abrInvoiceDate.InnerBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(254)))), ((int)(((byte)(254))))); this.abrInvoiceDate.isBorder3D = true; this.abrInvoiceDate.ItemsFont = new System.Drawing.Font("B Roya", 15F, System.Drawing.FontStyle.Bold); this.abrInvoiceDate.LinearListFont = new System.Drawing.Font("B Roya", 15F, System.Drawing.FontStyle.Bold); this.abrInvoiceDate.Location = new System.Drawing.Point(78, 538); this.abrInvoiceDate.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.abrInvoiceDate.MaximumSize = new System.Drawing.Size(175, 37); this.abrInvoiceDate.MinimumSize = new System.Drawing.Size(175, 37); this.abrInvoiceDate.Name = "abrInvoiceDate"; this.abrInvoiceDate.OuterBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); this.abrInvoiceDate.PanelEndBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(202)))), ((int)(((byte)(202))))); this.abrInvoiceDate.PanelStartBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(239)))), ((int)(((byte)(239))))); this.abrInvoiceDate.SelectedDate = new System.DateTime(2014, 9, 23, 1, 1, 1, 1); this.abrInvoiceDate.SelectedDateString = "1393/07/01"; this.abrInvoiceDate.SelectedMonthName = null; this.abrInvoiceDate.Size = new System.Drawing.Size(175, 37); this.abrInvoiceDate.StartOfYears = 1350; this.abrInvoiceDate.TabIndex = 33; // // label2 // this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(289, 67); this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label2.Name = "label2"; this.label2.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label2.Size = new System.Drawing.Size(46, 20); this.label2.TabIndex = 21; this.label2.Text = "مشتری"; // // label3 // this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(259, 545); this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label3.Name = "label3"; this.label3.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label3.Size = new System.Drawing.Size(71, 20); this.label3.TabIndex = 21; this.label3.Text = "تاریخ فاکتور"; // // btnAddCustomer // this.btnAddCustomer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnAddCustomer.Image = global::Store.Properties.Resources.edit_add; this.btnAddCustomer.Location = new System.Drawing.Point(29, 57); this.btnAddCustomer.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnAddCustomer.Name = "btnAddCustomer"; this.btnAddCustomer.Size = new System.Drawing.Size(36, 42); this.btnAddCustomer.TabIndex = 11; this.btnAddCustomer.UseVisualStyleBackColor = true; this.btnAddCustomer.Click += new System.EventHandler(this.btnAddCustomer_Click); // // btnSeparateInvoices // this.btnSeparateInvoices.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnSeparateInvoices.Image = global::Store.Properties.Resources.edit_add; this.btnSeparateInvoices.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.btnSeparateInvoices.Location = new System.Drawing.Point(348, 22); this.btnSeparateInvoices.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnSeparateInvoices.Name = "btnSeparateInvoices"; this.btnSeparateInvoices.Size = new System.Drawing.Size(152, 42); this.btnSeparateInvoices.TabIndex = 11; this.btnSeparateInvoices.Text = "انتقال به فاکتور جدید"; this.btnSeparateInvoices.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.btnSeparateInvoices.UseVisualStyleBackColor = true; this.btnSeparateInvoices.Click += new System.EventHandler(this.btnSeparateInvoices_Click); // // timer1 // this.timer1.Enabled = true; this.timer1.Interval = 300; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // listTimer // this.listTimer.Enabled = true; this.listTimer.Interval = 500; this.listTimer.Tick += new System.EventHandler(this.listTimer_Tick); // // itemTableAdapter // this.itemTableAdapter.ClearBeforeFill = true; // // invoiceTableAdapter // this.invoiceTableAdapter.ClearBeforeFill = true; // // invoiceItemTableAdapter // this.invoiceItemTableAdapter.ClearBeforeFill = true; // // chkChangeTextForID // this.chkChangeTextForID.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.chkChangeTextForID.AutoSize = true; this.chkChangeTextForID.Checked = true; this.chkChangeTextForID.CheckState = System.Windows.Forms.CheckState.Checked; this.chkChangeTextForID.Location = new System.Drawing.Point(902, 36); this.chkChangeTextForID.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.chkChangeTextForID.Name = "chkChangeTextForID"; this.chkChangeTextForID.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.chkChangeTextForID.Size = new System.Drawing.Size(110, 24); this.chkChangeTextForID.TabIndex = 3; this.chkChangeTextForID.Text = "کد جایگزین شود"; this.chkChangeTextForID.UseVisualStyleBackColor = true; // // lblTimestamp // this.lblTimestamp.AutoSize = true; this.lblTimestamp.Location = new System.Drawing.Point(3, 3); this.lblTimestamp.Name = "lblTimestamp"; this.lblTimestamp.Size = new System.Drawing.Size(44, 20); this.lblTimestamp.TabIndex = 34; this.lblTimestamp.Text = "label4"; // // label1 // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(270, 173); this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label1.Name = "label1"; this.label1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label1.Size = new System.Drawing.Size(51, 20); this.label1.TabIndex = 23; this.label1.Text = "مجموع :"; // // lblTotalPrice // this.lblTotalPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lblTotalPrice.AutoSize = true; this.lblTotalPrice.Location = new System.Drawing.Point(65, 178); this.lblTotalPrice.Name = "lblTotalPrice"; this.lblTotalPrice.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.lblTotalPrice.Size = new System.Drawing.Size(89, 20); this.lblTotalPrice.TabIndex = 22; this.lblTotalPrice.Text = "----------"; this.lblTotalPrice.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lblTotalPayable // this.lblTotalPayable.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lblTotalPayable.AutoSize = true; this.lblTotalPayable.Font = new System.Drawing.Font("XB Roya", 14F); this.lblTotalPayable.Location = new System.Drawing.Point(59, 293); this.lblTotalPayable.Name = "lblTotalPayable"; this.lblTotalPayable.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.lblTotalPayable.Size = new System.Drawing.Size(123, 30); this.lblTotalPayable.TabIndex = 22; this.lblTotalPayable.Text = "----------"; this.lblTotalPayable.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label6 // this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label6.AutoSize = true; this.label6.Font = new System.Drawing.Font("XB Roya", 14F); this.label6.Location = new System.Drawing.Point(210, 293); this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label6.Name = "label6"; this.label6.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label6.Size = new System.Drawing.Size(112, 30); this.label6.TabIndex = 23; this.label6.Text = "قابل دریافت:"; // // InvoiceSaleForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 19F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Lime; this.ClientSize = new System.Drawing.Size(1362, 643); this.Controls.Add(this.lblTimestamp); this.Controls.Add(this.abrInvoiceDate); this.Controls.Add(this.cmbCustomers); this.Controls.Add(this.chkChangeTextForID); this.Controls.Add(this.chkReportOutput); this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.groupBox1); this.Controls.Add(this.btnAddToInvoice); this.Controls.Add(this.btnSeparateInvoices); this.Controls.Add(this.btnAddCustomer); this.Controls.Add(this.btnDeleteInvoiceItem); this.Controls.Add(this.btnCreateInvoice); this.Controls.Add(this.lstTotal); this.Controls.Add(this.lstItems); this.Controls.Add(this.label11); this.Controls.Add(this.txtItemNameID); this.Font = new System.Drawing.Font("XB Roya", 9.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.KeyPreview = true; this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Name = "InvoiceSaleForm"; this.Text = "فاکتور فروش"; this.Activated += new System.EventHandler(this.InvoiceSaleForm_Activated); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.InvoiceSaleForm_FormClosing); this.Load += new System.EventHandler(this.InvoiceSaleForm_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.InvoiceSaleForm_KeyDown); this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.InvoiceSaleForm_KeyPress); ((System.ComponentModel.ISupportInitialize)(this.customerBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.storeDBDataSet)).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numExpenses)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numDiscount)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bankAccountBindingSource)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
public Customer.CustomerDataTable GetAllCustomers() { var customer=new Customer.CustomerDataTable(); var customerTableAdapter=new CustomerTableAdapter(); customerTableAdapter.Connection = DataProvider.ConnectionData(sr); customerTableAdapter.Fill(customer); return customer; }
public Customer.CustomerDataTable GetCustomerByID(string id) { var customer = new Customer.CustomerDataTable(); var customerTableAdapter = new CustomerTableAdapter(); customerTableAdapter.Connection = DataProvider.ConnectionData(sr); customerTableAdapter.FillByCustomerID(customer, id); return customer; }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.txtDistName = new System.Windows.Forms.TextBox(); this.txtDistAddress = new System.Windows.Forms.TextBox(); this.txtDistPhone1 = new System.Windows.Forms.TextBox(); this.txtDistPhone2 = new System.Windows.Forms.TextBox(); this.txtDistPhone3 = new System.Windows.Forms.TextBox(); this.txtDistID = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.lstDistributors = new System.Windows.Forms.ListView(); this.ID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.DistName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.Address = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.phone1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.phone2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.phone3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.btnAddDist = new System.Windows.Forms.Button(); this.btnDeleteDist = new System.Windows.Forms.Button(); this.lstCustomers = new System.Windows.Forms.ListView(); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.txtCustomerName = new System.Windows.Forms.TextBox(); this.txtCustomerDebt = new System.Windows.Forms.TextBox(); this.label7 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.btnAddCustomer = new System.Windows.Forms.Button(); this.btnDeleteCustomer = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.numNewDebt = new System.Windows.Forms.NumericUpDown(); this.btnSaveDebt = new System.Windows.Forms.Button(); this.numCurrentDebt = new System.Windows.Forms.NumericUpDown(); this.label13 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label(); this.txtCustomerLastInvoice = new System.Windows.Forms.TextBox(); this.txtCustomerLastPayment = new System.Windows.Forms.TextBox(); this.txtCustomerID = new System.Windows.Forms.TextBox(); this.label9 = new System.Windows.Forms.Label(); this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); this.distributorTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.DistributorTableAdapter(); this.customerTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.CustomerTableAdapter(); this.invoiceTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.InvoiceTableAdapter(); this.viewDistributorNameOnInvoiceTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.ViewDistributorNameOnInvoiceTableAdapter(); this.viewCustomerOnInvoiceTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.ViewCustomerOnInvoiceTableAdapter(); this.dailyTransactionTableAdapter = new Store.DB.StoreDBDataSetTableAdapters.DailyTransactionTableAdapter(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.label11 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numNewDebt)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numCurrentDebt)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); this.groupBox3.SuspendLayout(); this.SuspendLayout(); // // txtDistName // this.txtDistName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.txtDistName.Location = new System.Drawing.Point(395, 548); this.txtDistName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtDistName.Name = "txtDistName"; this.txtDistName.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtDistName.Size = new System.Drawing.Size(77, 27); this.txtDistName.TabIndex = 0; this.txtDistName.TextChanged += new System.EventHandler(this.txtDistName_TextChanged); // // txtDistAddress // this.txtDistAddress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.txtDistAddress.Enabled = false; this.txtDistAddress.Location = new System.Drawing.Point(262, 548); this.txtDistAddress.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtDistAddress.Name = "txtDistAddress"; this.txtDistAddress.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtDistAddress.Size = new System.Drawing.Size(125, 27); this.txtDistAddress.TabIndex = 0; // // txtDistPhone1 // this.txtDistPhone1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.txtDistPhone1.Location = new System.Drawing.Point(181, 548); this.txtDistPhone1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtDistPhone1.Name = "txtDistPhone1"; this.txtDistPhone1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtDistPhone1.Size = new System.Drawing.Size(74, 27); this.txtDistPhone1.TabIndex = 0; this.txtDistPhone1.TextChanged += new System.EventHandler(this.txtDistPhone1_TextChanged); this.txtDistPhone1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtDistPhone1_KeyPress); // // txtDistPhone2 // this.txtDistPhone2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.txtDistPhone2.Enabled = false; this.txtDistPhone2.Location = new System.Drawing.Point(97, 548); this.txtDistPhone2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtDistPhone2.Name = "txtDistPhone2"; this.txtDistPhone2.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtDistPhone2.Size = new System.Drawing.Size(76, 27); this.txtDistPhone2.TabIndex = 0; this.txtDistPhone2.TextChanged += new System.EventHandler(this.txtDistPhone2_TextChanged); this.txtDistPhone2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtDistPhone2_KeyPress); // // txtDistPhone3 // this.txtDistPhone3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.txtDistPhone3.Enabled = false; this.txtDistPhone3.Location = new System.Drawing.Point(14, 548); this.txtDistPhone3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtDistPhone3.Name = "txtDistPhone3"; this.txtDistPhone3.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtDistPhone3.Size = new System.Drawing.Size(75, 27); this.txtDistPhone3.TabIndex = 0; // // txtDistID // this.txtDistID.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.txtDistID.Enabled = false; this.txtDistID.Location = new System.Drawing.Point(481, 548); this.txtDistID.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtDistID.Name = "txtDistID"; this.txtDistID.ReadOnly = true; this.txtDistID.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtDistID.Size = new System.Drawing.Size(69, 27); this.txtDistID.TabIndex = 0; // // label1 // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(510, 525); this.label1.Name = "label1"; this.label1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label1.Size = new System.Drawing.Size(42, 20); this.label1.TabIndex = 1; this.label1.Text = "شناسه"; // // label2 // this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(450, 525); this.label2.Name = "label2"; this.label2.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label2.Size = new System.Drawing.Size(24, 20); this.label2.TabIndex = 1; this.label2.Text = "نام"; // // label3 // this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(353, 525); this.label3.Name = "label3"; this.label3.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label3.Size = new System.Drawing.Size(40, 20); this.label3.TabIndex = 1; this.label3.Text = "آدرس"; // // label4 // this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(216, 525); this.label4.Name = "label4"; this.label4.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label4.Size = new System.Drawing.Size(39, 20); this.label4.TabIndex = 1; this.label4.Text = "تلفن1"; // // label5 // this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(136, 525); this.label5.Name = "label5"; this.label5.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label5.Size = new System.Drawing.Size(39, 20); this.label5.TabIndex = 1; this.label5.Text = "تلفن2"; // // label6 // this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(55, 525); this.label6.Name = "label6"; this.label6.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label6.Size = new System.Drawing.Size(39, 20); this.label6.TabIndex = 1; this.label6.Text = "تلفن3"; // // lstDistributors // this.lstDistributors.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.lstDistributors.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.ID, this.DistName, this.Address, this.phone1, this.phone2, this.phone3}); this.lstDistributors.FullRowSelect = true; this.lstDistributors.Location = new System.Drawing.Point(14, 28); this.lstDistributors.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.lstDistributors.MultiSelect = false; this.lstDistributors.Name = "lstDistributors"; this.lstDistributors.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.lstDistributors.RightToLeftLayout = true; this.lstDistributors.Size = new System.Drawing.Size(536, 448); this.lstDistributors.TabIndex = 2; this.lstDistributors.UseCompatibleStateImageBehavior = false; this.lstDistributors.View = System.Windows.Forms.View.Details; this.lstDistributors.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lists_ColumnClick); this.lstDistributors.SelectedIndexChanged += new System.EventHandler(this.lstDistributors_SelectedIndexChanged); this.lstDistributors.DoubleClick += new System.EventHandler(this.list_DoubleClick); // // ID // this.ID.Text = "شناسه"; this.ID.Width = 65; // // DistName // this.DistName.Text = "نام"; this.DistName.Width = 70; // // Address // this.Address.Text = "آدرس"; this.Address.Width = 113; // // phone1 // this.phone1.Text = "تلفن"; this.phone1.Width = 72; // // phone2 // this.phone2.Text = "تلفن"; this.phone2.Width = 72; // // phone3 // this.phone3.Text = "تلفن"; this.phone3.Width = 64; // // btnAddDist // this.btnAddDist.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnAddDist.Enabled = false; this.btnAddDist.Location = new System.Drawing.Point(14, 487); this.btnAddDist.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnAddDist.Name = "btnAddDist"; this.btnAddDist.Size = new System.Drawing.Size(107, 34); this.btnAddDist.TabIndex = 3; this.btnAddDist.Text = "ذخیره در لیست"; this.btnAddDist.UseVisualStyleBackColor = true; this.btnAddDist.Click += new System.EventHandler(this.btnAddDist_Click); // // btnDeleteDist // this.btnDeleteDist.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnDeleteDist.Enabled = false; this.btnDeleteDist.Location = new System.Drawing.Point(412, 487); this.btnDeleteDist.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnDeleteDist.Name = "btnDeleteDist"; this.btnDeleteDist.Size = new System.Drawing.Size(139, 34); this.btnDeleteDist.TabIndex = 3; this.btnDeleteDist.Text = "حذف توزیع کننده"; this.btnDeleteDist.UseVisualStyleBackColor = true; this.btnDeleteDist.Click += new System.EventHandler(this.btnDeleteDist_Click); // // lstCustomers // this.lstCustomers.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lstCustomers.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, this.columnHeader2, this.columnHeader3, this.columnHeader4, this.columnHeader5}); this.lstCustomers.FullRowSelect = true; this.lstCustomers.Location = new System.Drawing.Point(7, 28); this.lstCustomers.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.lstCustomers.Name = "lstCustomers"; this.lstCustomers.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.lstCustomers.RightToLeftLayout = true; this.lstCustomers.Size = new System.Drawing.Size(475, 339); this.lstCustomers.TabIndex = 4; this.lstCustomers.UseCompatibleStateImageBehavior = false; this.lstCustomers.View = System.Windows.Forms.View.Details; this.lstCustomers.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lists_ColumnClick); this.lstCustomers.SelectedIndexChanged += new System.EventHandler(this.lstCustomers_SelectedIndexChanged); this.lstCustomers.DoubleClick += new System.EventHandler(this.list_DoubleClick); // // columnHeader1 // this.columnHeader1.Text = "شناسه"; // // columnHeader2 // this.columnHeader2.Text = "نام"; this.columnHeader2.Width = 73; // // columnHeader3 // this.columnHeader3.Text = "بدهی"; this.columnHeader3.Width = 65; // // columnHeader4 // this.columnHeader4.Text = "آخرین پرداخت"; this.columnHeader4.Width = 89; // // columnHeader5 // this.columnHeader5.Text = "آخرین خرید"; this.columnHeader5.Width = 99; // // txtCustomerName // this.txtCustomerName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtCustomerName.Location = new System.Drawing.Point(307, 53); this.txtCustomerName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtCustomerName.Name = "txtCustomerName"; this.txtCustomerName.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtCustomerName.Size = new System.Drawing.Size(84, 27); this.txtCustomerName.TabIndex = 0; this.txtCustomerName.TextChanged += new System.EventHandler(this.txtDistName_TextChanged); // // txtCustomerDebt // this.txtCustomerDebt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtCustomerDebt.Enabled = false; this.txtCustomerDebt.Location = new System.Drawing.Point(219, 53); this.txtCustomerDebt.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtCustomerDebt.Name = "txtCustomerDebt"; this.txtCustomerDebt.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtCustomerDebt.Size = new System.Drawing.Size(80, 27); this.txtCustomerDebt.TabIndex = 0; // // label7 // this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label7.AutoSize = true; this.label7.Location = new System.Drawing.Point(372, 29); this.label7.Name = "label7"; this.label7.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label7.Size = new System.Drawing.Size(24, 20); this.label7.TabIndex = 1; this.label7.Text = "نام"; // // label8 // this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label8.AutoSize = true; this.label8.Location = new System.Drawing.Point(265, 29); this.label8.Name = "label8"; this.label8.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label8.Size = new System.Drawing.Size(34, 20); this.label8.TabIndex = 1; this.label8.Text = "بدهی"; // // btnAddCustomer // this.btnAddCustomer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnAddCustomer.Location = new System.Drawing.Point(13, 85); this.btnAddCustomer.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnAddCustomer.Name = "btnAddCustomer"; this.btnAddCustomer.Size = new System.Drawing.Size(199, 34); this.btnAddCustomer.TabIndex = 3; this.btnAddCustomer.Text = "ذخیره در لیست"; this.btnAddCustomer.UseVisualStyleBackColor = true; this.btnAddCustomer.Click += new System.EventHandler(this.btnAddCustomer_Click); // // btnDeleteCustomer // this.btnDeleteCustomer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnDeleteCustomer.Enabled = false; this.btnDeleteCustomer.Location = new System.Drawing.Point(373, 85); this.btnDeleteCustomer.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnDeleteCustomer.Name = "btnDeleteCustomer"; this.btnDeleteCustomer.Size = new System.Drawing.Size(96, 34); this.btnDeleteCustomer.TabIndex = 3; this.btnDeleteCustomer.Text = "حذف مشتری"; this.btnDeleteCustomer.UseVisualStyleBackColor = true; this.btnDeleteCustomer.Click += new System.EventHandler(this.btnDeleteCustomer_Click); // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBox1.Controls.Add(this.btnAddDist); this.groupBox1.Controls.Add(this.lstDistributors); this.groupBox1.Controls.Add(this.txtDistName); this.groupBox1.Controls.Add(this.btnDeleteDist); this.groupBox1.Controls.Add(this.txtDistID); this.groupBox1.Controls.Add(this.txtDistAddress); this.groupBox1.Controls.Add(this.txtDistPhone1); this.groupBox1.Controls.Add(this.txtDistPhone2); this.groupBox1.Controls.Add(this.label6); this.groupBox1.Controls.Add(this.txtDistPhone3); this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Location = new System.Drawing.Point(532, 18); this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBox1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.groupBox1.Size = new System.Drawing.Size(558, 604); this.groupBox1.TabIndex = 5; this.groupBox1.TabStop = false; this.groupBox1.Text = "توزیع کننده ها"; // // groupBox2 // this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBox2.Controls.Add(this.groupBox4); this.groupBox2.Controls.Add(this.lstCustomers); this.groupBox2.Location = new System.Drawing.Point(28, 18); this.groupBox2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBox2.Name = "groupBox2"; this.groupBox2.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBox2.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.groupBox2.Size = new System.Drawing.Size(497, 604); this.groupBox2.TabIndex = 6; this.groupBox2.TabStop = false; this.groupBox2.Text = "مشتری ها"; // // groupBox4 // this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBox4.Controls.Add(this.numNewDebt); this.groupBox4.Controls.Add(this.btnSaveDebt); this.groupBox4.Controls.Add(this.numCurrentDebt); this.groupBox4.Controls.Add(this.label13); this.groupBox4.Controls.Add(this.label12); this.groupBox4.Location = new System.Drawing.Point(7, 513); this.groupBox4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBox4.Name = "groupBox4"; this.groupBox4.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBox4.Size = new System.Drawing.Size(476, 82); this.groupBox4.TabIndex = 5; this.groupBox4.TabStop = false; this.groupBox4.Text = " تغییر مبلغ بدهی (افزایش/کاهش) "; // // numNewDebt // this.numNewDebt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.numNewDebt.Location = new System.Drawing.Point(202, 44); this.numNewDebt.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.numNewDebt.Maximum = new decimal(new int[] { -1981284353, -1966660860, 0, 0}); this.numNewDebt.Name = "numNewDebt"; this.numNewDebt.Size = new System.Drawing.Size(127, 27); this.numNewDebt.TabIndex = 0; this.numNewDebt.ThousandsSeparator = true; // // btnSaveDebt // this.btnSaveDebt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnSaveDebt.Location = new System.Drawing.Point(7, 39); this.btnSaveDebt.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnSaveDebt.Name = "btnSaveDebt"; this.btnSaveDebt.Size = new System.Drawing.Size(104, 34); this.btnSaveDebt.TabIndex = 3; this.btnSaveDebt.Text = "ذخیره"; this.btnSaveDebt.UseVisualStyleBackColor = true; this.btnSaveDebt.Click += new System.EventHandler(this.btnSaveDebt_Click); // // numCurrentDebt // this.numCurrentDebt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.numCurrentDebt.Enabled = false; this.numCurrentDebt.Location = new System.Drawing.Point(336, 44); this.numCurrentDebt.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.numCurrentDebt.Maximum = new decimal(new int[] { -1981284353, -1966660860, 0, 0}); this.numCurrentDebt.Name = "numCurrentDebt"; this.numCurrentDebt.Size = new System.Drawing.Size(127, 27); this.numCurrentDebt.TabIndex = 0; this.numCurrentDebt.ThousandsSeparator = true; // // label13 // this.label13.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label13.AutoSize = true; this.label13.Location = new System.Drawing.Point(266, 23); this.label13.Name = "label13"; this.label13.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label13.Size = new System.Drawing.Size(64, 20); this.label13.TabIndex = 1; this.label13.Text = "بدهی جدید"; // // label12 // this.label12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label12.AutoSize = true; this.label12.Location = new System.Drawing.Point(395, 23); this.label12.Name = "label12"; this.label12.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label12.Size = new System.Drawing.Size(61, 20); this.label12.TabIndex = 1; this.label12.Text = "بدهی فعلی"; // // txtCustomerLastInvoice // this.txtCustomerLastInvoice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtCustomerLastInvoice.Enabled = false; this.txtCustomerLastInvoice.Location = new System.Drawing.Point(14, 53); this.txtCustomerLastInvoice.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtCustomerLastInvoice.Name = "txtCustomerLastInvoice"; this.txtCustomerLastInvoice.ReadOnly = true; this.txtCustomerLastInvoice.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtCustomerLastInvoice.Size = new System.Drawing.Size(96, 27); this.txtCustomerLastInvoice.TabIndex = 0; // // txtCustomerLastPayment // this.txtCustomerLastPayment.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtCustomerLastPayment.Enabled = false; this.txtCustomerLastPayment.Location = new System.Drawing.Point(118, 53); this.txtCustomerLastPayment.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtCustomerLastPayment.Name = "txtCustomerLastPayment"; this.txtCustomerLastPayment.ReadOnly = true; this.txtCustomerLastPayment.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtCustomerLastPayment.Size = new System.Drawing.Size(94, 27); this.txtCustomerLastPayment.TabIndex = 0; // // txtCustomerID // this.txtCustomerID.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtCustomerID.Enabled = false; this.txtCustomerID.Location = new System.Drawing.Point(399, 53); this.txtCustomerID.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtCustomerID.Name = "txtCustomerID"; this.txtCustomerID.ReadOnly = true; this.txtCustomerID.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.txtCustomerID.Size = new System.Drawing.Size(69, 27); this.txtCustomerID.TabIndex = 0; // // label9 // this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(428, 29); this.label9.Name = "label9"; this.label9.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label9.Size = new System.Drawing.Size(42, 20); this.label9.TabIndex = 1; this.label9.Text = "شناسه"; // // errorProvider // this.errorProvider.ContainerControl = this; // // distributorTableAdapter // this.distributorTableAdapter.ClearBeforeFill = true; // // customerTableAdapter // this.customerTableAdapter.ClearBeforeFill = true; // // invoiceTableAdapter // this.invoiceTableAdapter.ClearBeforeFill = true; // // viewDistributorNameOnInvoiceTableAdapter // this.viewDistributorNameOnInvoiceTableAdapter.ClearBeforeFill = true; // // viewCustomerOnInvoiceTableAdapter // this.viewCustomerOnInvoiceTableAdapter.ClearBeforeFill = true; // // dailyTransactionTableAdapter // this.dailyTransactionTableAdapter.ClearBeforeFill = true; // // timer1 // this.timer1.Enabled = true; this.timer1.Interval = 500; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // groupBox3 // this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBox3.Controls.Add(this.txtCustomerID); this.groupBox3.Controls.Add(this.btnDeleteCustomer); this.groupBox3.Controls.Add(this.btnAddCustomer); this.groupBox3.Controls.Add(this.label7); this.groupBox3.Controls.Add(this.label9); this.groupBox3.Controls.Add(this.txtCustomerName); this.groupBox3.Controls.Add(this.label11); this.groupBox3.Controls.Add(this.label10); this.groupBox3.Controls.Add(this.label8); this.groupBox3.Controls.Add(this.txtCustomerLastInvoice); this.groupBox3.Controls.Add(this.txtCustomerDebt); this.groupBox3.Controls.Add(this.txtCustomerLastPayment); this.groupBox3.Location = new System.Drawing.Point(35, 395); this.groupBox3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBox3.Name = "groupBox3"; this.groupBox3.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBox3.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.groupBox3.Size = new System.Drawing.Size(476, 127); this.groupBox3.TabIndex = 5; this.groupBox3.TabStop = false; this.groupBox3.Text = " ثبت جدید و تغییر نام "; // // label11 // this.label11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(34, 29); this.label11.Name = "label11"; this.label11.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label11.Size = new System.Drawing.Size(75, 20); this.label11.TabIndex = 1; this.label11.Text = "آخرین فاکتور"; // // label10 // this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(135, 29); this.label10.Name = "label10"; this.label10.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label10.Size = new System.Drawing.Size(83, 20); this.label10.TabIndex = 1; this.label10.Text = "آخرین پرداخت"; // // AccountantsManageForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 19F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.DarkTurquoise; this.ClientSize = new System.Drawing.Size(1104, 627); this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Font = new System.Drawing.Font("XB Roya", 9.25F); this.KeyPreview = true; this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Name = "AccountantsManageForm"; this.Text = "مدیریت طرف حسابها"; this.Activated += new System.EventHandler(this.AccountantsManageForm_Activated); this.Load += new System.EventHandler(this.AccountantsManageForm_Load); this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.AccountantsManageForm_KeyPress); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numNewDebt)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numCurrentDebt)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); this.ResumeLayout(false); }
protected void odsSKUDetails_Updating(object sender, ObjectDataSourceMethodEventArgs e) { DropDownList SKUDDL = (DropDownList)this.gvSKUDetails.Rows[this.gvSKUDetails.EditIndex].FindControl("SKUDDL"); MasterData.CustomerRow customer = new CustomerTableAdapter().GetDataByID(int.Parse(this.ViewState["CustomerID"].ToString()))[0]; decimal deliveryPrice = new MasterDataBLL().GetSKUPriceByParameter(int.Parse(SKUDDL.SelectedValue), customer.CustomerTypeID, customer.CustomerChannelID); if (deliveryPrice == 0) { PageUtility.ShowModelDlg(this.Page, "没有找到该产品供货价,请联系管理员", "can't find the delivery price for this SKU"); e.Cancel = true; return; } else { e.InputParameters["SKUID"] = SKUDDL.SelectedValue; e.InputParameters["DeliveryPrice"] = deliveryPrice; } TextBox DiscountCtl = (TextBox)this.gvSKUDetails.Rows[this.gvSKUDetails.EditIndex].FindControl("DiscountCtl"); TextBox DiscountCampbellCtl = (TextBox)this.gvSKUDetails.Rows[this.gvSKUDetails.EditIndex].FindControl("DiscountCampbellCtl"); TextBox PriceDiscountAmountCtl = (TextBox)this.gvSKUDetails.Rows[this.gvSKUDetails.EditIndex].FindControl("PriceDiscountAmountCtl"); TextBox RemarkCtl = (TextBox)this.gvSKUDetails.Rows[this.gvSKUDetails.EditIndex].FindControl("RemarkCtl"); decimal discount = 0; decimal discountCampbell = 0; decimal priceDiscount = 0; if (DiscountCtl.Text != string.Empty) { discount = decimal.Parse(DiscountCtl.Text); } if (DiscountCampbellCtl.Text != string.Empty) { discountCampbell = decimal.Parse(DiscountCampbellCtl.Text); } if (PriceDiscountAmountCtl.Text != string.Empty) { priceDiscount = decimal.Parse(PriceDiscountAmountCtl.Text); } //add 20130807 if (!string.IsNullOrEmpty(PriceDiscountAmountCtl.Text.Trim()) && priceDiscount != 0 && string.IsNullOrEmpty(RemarkCtl.Text.Trim())) { PageUtility.ShowModelDlg(this.Page, "请在备注中填写,折扣让利费用计算公式", "please input in the remark box, price discount amount calculated formula"); e.Cancel = true; return; } //end if (!((discount == 0 && discountCampbell == 0 && priceDiscount == 0) || (discount != 0 && discountCampbell != 0 && priceDiscount != 0))) { PageUtility.ShowModelDlg(this.Page, "折扣比例和折扣让利费用应该同时有值", "discount and price discount fee should have value at the same time"); e.Cancel = true; return; } else { e.InputParameters["PriceDiscountAmountRMB"] = decimal.Round(priceDiscount * decimal.Parse(this.ViewState["ExchangeRate"].ToString()), 2); } }
public void Tables_InvalidBenefitsTables_Relationship_DeleteCascadTest() { ConnectionManager.SetConnection("Supervisor", "admin"); BaseTableAdapter tableAdapter = new GenderTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; Tables tables = new Tables(); tableAdapter.Fill(tables.GenderDataTable); tableAdapter = new ApppTprTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.ApppDataTable); tableAdapter = new CustomerTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.CustomerDataTable); tableAdapter = new BenefitsCategoryTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.BenefitsDataTable); tableAdapter = new ChiperReceptTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.ChiperReceptDataTable); tableAdapter = new DisabilityGroupTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.DisabilityGroupDataTable); tableAdapter = new InvalidTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.InvalidDataTable); tableAdapter = new InvalidBenefitsCategoryTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.InvalidBenefitsDataTable); int countRows = tables.InvalidBenefitsDataTable.Rows.Count; bool isRow = false; for (int i = 0; i < tables.InvalidBenefitsDataTable.Rows.Count; i++) { int invalidId = Int32.Parse(tables.InvalidBenefitsDataTable.Rows[tables.InvalidBenefitsDataTable.Rows.Count - 1]["InvID"].ToString()); Debug.WriteLine("InvID " + invalidId); int customerId = -10; for (int j = 0; j < tables.InvalidDataTable.Rows.Count; j++) { if (Int32.Parse(tables.InvalidDataTable.Rows[j][0].ToString()) == invalidId) { customerId = Int32.Parse(tables.InvalidDataTable.Rows[j]["CustomerID"].ToString()); isRow = true; Debug.WriteLine("CustomerID " + customerId); break; } } if (isRow) { for (int z = 0; z < tables.CustomerDataTable.Rows.Count; z++) { if (Int32.Parse(tables.CustomerDataTable.Rows[z][0].ToString()) == customerId) { tables.CustomerDataTable.Rows[z].Delete(); break; } } } if (isRow) { break; } } tableAdapter = new CustomerTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; ((UpdateBaseTableAdapter)tableAdapter).Update(tables.CustomerDataTable); tables.InvalidBenefitsDataTable.Clear(); tableAdapter = new InvalidTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.InvalidDataTable); tableAdapter = new InvalidBenefitsCategoryTableAdapter(); tableAdapter.Connection = ConnectionManager.Connection; tableAdapter.Fill(tables.InvalidBenefitsDataTable); Assert.IsTrue(countRows - tables.InvalidBenefitsDataTable.Rows.Count >= 1); }
private void CustomerForm_Load(object sender, EventArgs e) { try { adapter = new CustomerTableAdapter(); adapter.Connection = cnSql; dataTable = new DataSet.CustomerDataTable(); adapter.Fill(dataTable); enableForm(false); } catch (Exception ex) { MessageBox.Show(ex.Message); } populateCustomersList(); }
private void btnAra_Click(object sender, EventArgs e) { CustomerTableAdapter.FillBy(this.Store_ManagerDataSet.Customer, "%" + txtBoxAdı.Text + "%", "%" + txtBoxSoyadı.Text + "%"); raporMüşteriGöster.RefreshReport(); }