private void btnfactor_Click(object sender, EventArgs e) { if (myLibrary.l1.Count == 0) { MessageBox.Show("لطفا فاکتور را کامل سپس صادر کنيد", "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txtname1.Focus(); return; } if (txtphone.Text.Length != 11) { MessageBox.Show("لطفا شماره تماس مشتري را وارد کنيد", "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txtphone.Focus(); return; } //if (txtshop.Text.Length < 4) //{ // MessageBox.Show("لطفا نام فروشگاه را وارد کنيد", "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); // txtshop.Focus(); // return; //} string id = db1.NewFactor(txtphone.Text); myLibrary.ExecuteRequest("action=newfactor&phone=" + txtphone.Text + "&username="******"&date=" + myLibrary.getDate() + "&factor_id=" + id + "&factor=" + myLibrary.factorList.List2Json(), myLibrary.BaseUrl + "factor.php"); frmToast t1 = new frmToast(); t1.setComment = "فاکتور با موفقيت صادر شد"; t1.Show(); pnllist.Controls.Clear(); sTop = 0; myLibrary.l1.Clear(); txttotalall.Text = "0"; }
private void btnpreview_Click(object sender, EventArgs e) { MYButton m1 = sender as MYButton; FactorItem[] dt1 = m1.Tag as FactorItem[]; frmgetFactorlistproduct fgp = new frmgetFactorlistproduct(); object[] oj1 = new object[1]; oj1[0] = dt1; fgp.fillData(oj1); fgp.sDate = txtdate.Text; fgp.sShopName = txtshop.Text; fgp.sPhone = txtshop.Tag.ToString(); fgp.FactorID = txtcode.Text; fgp.ShowDialog(); if (fgp.blnAccept == true) { myLibrary.currentParent.Controls.Remove(this.Tag as newFactorItem); frmToast Toast = new frmToast(); Toast.setComment = "اقلام موجود به انبار اضافه شد"; Toast.Show(); } }