private void FormSms_Load(object sender, EventArgs e) { dtSearch.Text = Practical.Today_Date(); comRemeberBirthDay.SelectedIndex = 0; try { using (var context = new StimulsoftEntities()) { var set = context.Setting.FirstOrDefault(); if (set != null) { txtSignature.Text = set.Signature; txtSMSnumber.Text = set.NumberSms; } else { MessageBox.Show("از بخش تنظیمات امضا و شماره پیامک را وارد کنید", "هشدار", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void dgAnbar_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e) { lblTotalPrice.Text = Practical.Sum_price_DataGrideView(dgAnbar, 4); if (dgAnbar.RowCount == 0) { btnSaveAllProdoct.Enabled = false; } }
//************** private void FormReports_Load(object sender, EventArgs e) { //------ using (var context = new StimulsoftEntities()) { if (PanelUser.Visible == true) // amade kardane panel user baraye gozaresh bar asase moshtari { var select = context.Service.ToList(); string[] eshterak = new string[select.Count]; for (int i = 0; i < select.Count; i++) { eshterak[i] = select[i].Eshterak.ToString(); } AutoCompleteStringCollection suggestEshterak = new AutoCompleteStringCollection(); txtEshterak.AutoCompleteCustomSource = suggestEshterak; suggestEshterak.AddRange(eshterak); //------- string[] phone = new string[select.Count]; for (int i = 0; i < select.Count; i++) { phone[i] = select[i].Mobile.ToString(); } AutoCompleteStringCollection suggestPhone = new AutoCompleteStringCollection(); txtPhone.AutoCompleteCustomSource = suggestPhone; suggestPhone.AddRange(phone); } if (panelProdoct.Visible == true)// amade kardane panel prodoct baraye gozaresh bar asase mahsool { panelProdoct.BringToFront(); var category = context.Category.ToList(); if (category.Count > 0) { comCategory.DataSource = category; comCategory.DisplayMember = "Name"; } //--------- var prodoct = context.Prodoct.Where(c => c.NameService == comCategory.Text).ToList(); comProdoct.DataSource = prodoct; comProdoct.DisplayMember = "Name"; //---------- dtStart1.Text = Practical.Today_Date(); dtEnd1.Text = Practical.Today_Date(); //---------- label4.Text = "تعداد:"; label7.Visible = false; label9.Visible = false; lblTotalMande.Visible = false; lblTotallTakhfif.Visible = false; } } //----------- if (PanelDate.Visible == true) // amade kardane panel date baraye gozaresh bar asase zaman { dtStart.Today_Click(null, null); dtEnd.Today_Click(null, null); } //------ }
private void FormSearch_Load(object sender, EventArgs e) { dtSearch.Text = Practical.Today_Date(); comSearch.SelectedIndex = 0; dtSearch.Visible = true; //***************** //lblError.Location = new System.Drawing.Point(456, 430); //----- }
private void FormReportAnbar_Load(object sender, EventArgs e) { DateFirst.Text = Practical.Today_Date(); DateEnd.Text = Practical.Today_Date(); StimulsoftEntities context = new StimulsoftEntities(); if (context.AnbarProdoct.Count() > 0) { var prodocts = context.AnbarProdoct.ToList(); comProdoct.DataSource = prodocts; comProdoct.DisplayMember = "Name"; Refresh_dgSearch(); } }
private void FormAnbar_Load(object sender, EventArgs e) { Date.Text = Practical.Today_Date(); dateExpird.Text = Practical.Today_Date(); comCase.SelectedIndex = 0; //dgAnbar.Enabled = false; groupProdoct.Enabled = false; //dateExpird.Text = Practical.Today_Date(); dateExpird.ForeColor = Color.DarkGray; //dateExpird.Text = "تاریخ انقضا"; Refresh_dgProdoct(); Refresh_dgStore(); dgProdoct.ClearSelection(); dgStore.ClearSelection(); }
private string Sugettion_Price(string NameProdoct) // pishnahad dadane mahsool bar asase akharin gheimat { StimulsoftEntities context = new StimulsoftEntities(); string price = ""; if (context.Anbar.Count() > 0) { var selectAll = context.Anbar.Where(c => c.Name == NameProdoct).ToList(); var selectEnd = selectAll.LastOrDefault(); if (selectEnd == null) { return(price = "خرید و فروش نشده"); } int countProdoct = Convert.ToInt16(selectEnd.Positiv + selectEnd.Negativ); price = (selectEnd.Price / countProdoct).ToString(); price = Practical.split_3Number(price); } else { price = "محصولی ثبت نشده"; } return(price); }
private void txtAccountNumber_KeyPress(object sender, KeyPressEventArgs e) { Practical.Enter_Number(sender, e); }
private void txtPhone_KeyPress_1(object sender, KeyPressEventArgs e) { Practical.Enter_Number(sender, e); }
private void txtPhone_TextChanged_2(object sender, EventArgs e) { txtEshterak.Text = Practical.Build_Eshterak_Number(txtPhone.Text); }
private void MainForm_Load(object sender, EventArgs e) { dateEnter.Text = Practical.Today_Date(); //dateBirthDay.Text = Practical.Today_Date(); }
private void FormBirthDay_Load(object sender, EventArgs e) { dtBirthDay.Text = Practical.Today_Date(); comRemeberBirthDay.SelectedIndex = 0; }
private void dgAnbar_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e) { lblTotalPrice.Text = Practical.Sum_price_DataGrideView(dgAnbar, 4); btnSaveAllProdoct.Enabled = true; }
private void txtPriceProdoct_TextChanged(object sender, EventArgs e) { txtPriceProdoct.Text = Practical.split_3Number(txtPriceProdoct.Text); txtPriceProdoct.Select(txtPriceProdoct.TextLength, 0); }
private void txtPriceProdoct_KeyPress(object sender, KeyPressEventArgs e) { Practical.Enter_Number(sender, e); }
public string[] prodoct() // gereftane maghadir va baraye ezafe kardane prodoct { string[] prodoct1; if (dgProdoct.SelectedRows.Count < 1) { MessageBox.Show("محصول را انتخاب کنید", "انتخاب", MessageBoxButtons.OK, MessageBoxIcon.Warning); prodoct1 = new string[] { "-1" }; dgProdoct.Focus(); return(prodoct1); } if (dgStore.SelectedRows.Count < 1) { MessageBox.Show("فروشگاه یا فرد را انتخاب کنید", "انتخاب", MessageBoxButtons.OK, MessageBoxIcon.Warning); prodoct1 = new string[] { "-1" }; dgStore.Focus(); return(prodoct1); } if (txtSomeProdoct.Text == "" || txtSomeProdoct.Text == "مقدار") { MessageBox.Show("مقدار را وارد کنید", "انتخاب", MessageBoxButtons.OK, MessageBoxIcon.Warning); prodoct1 = new string[] { "-1" }; txtSomeProdoct.Focus(); return(prodoct1); } if (comCase.SelectedIndex == 1 || comCase.SelectedIndex == 2 || comCase.SelectedIndex == 6) { if (int.Parse(lblExistingProdoct.Text) < int.Parse(txtSomeProdoct.Text)) { MessageBox.Show("موجودی انبار کافی نیست", "انبار", MessageBoxButtons.OK, MessageBoxIcon.Warning); prodoct1 = new string[] { "-1" }; txtSomeProdoct.Focus(); return(prodoct1); } } if (txtPriceProdoct.Text == "" || txtPriceProdoct.Text == "قیمت") { MessageBox.Show("قیمت را وارد کنید", "انتخاب", MessageBoxButtons.OK, MessageBoxIcon.Warning); prodoct1 = new string[] { "-1" }; txtPriceProdoct.Focus(); return(prodoct1); } if (dateExpird.Text == "" || dateExpird.Text == "تاریخ انقضا") { MessageBox.Show("تاریخ را انتخاب کنید", "انتخاب", MessageBoxButtons.OK, MessageBoxIcon.Warning); prodoct1 = new string[] { "-1" }; dateExpird.Focus(); return(prodoct1); } if (txtDetailProdoct.Text == "توضیحات") { txtDetailProdoct.ForeColor = Color.Black; txtDetailProdoct.Text = ""; } if (lblCodeRahgiri.Text == "") { MessageBox.Show("کد رهگیری ندارد", "کد رهگیری", MessageBoxButtons.OK, MessageBoxIcon.Warning); prodoct1 = new string[] { "-1" }; return(prodoct1); } long price = long.Parse(txtPriceProdoct.Text.Replace(",", "")); long some = long.Parse(txtSomeProdoct.Text); price *= some; prodoct1 = new string[] { dgProdoct.CurrentRow.Cells[3].Value.ToString(), dgProdoct.CurrentRow.Cells[2].Value.ToString(), dgStore.CurrentRow.Cells[1].Value.ToString(), txtSomeProdoct.Text, Practical.split_3Number(price.ToString()), txtDetailProdoct.Text, dateExpird.Text }; return(prodoct1); }