Ejemplo n.º 1
0
        private void globalHelpEnactmentForm_Load(object sender, EventArgs e)
        {
            typeComboBox.DropDownStyle          = ComboBoxStyle.DropDownList;
            enactmentTextbox.SelectionAlignment = HorizontalAlignment.Center;
            if (this.Text == "ویرایش کمک جمعی با مصوبه")
            {
                this.BackColor = Color.Yellow; delButton.Visible = true;
                SqlConnection con = new SqlConnection(this.connection);
                con.Open();

                SqlCommand cmdget = new SqlCommand("select type, fee, packets, startdate, enactmentId, status, metric, description, subdate from GlobalHelps where id = @id;", con);
                cmdget.Parameters.AddWithValue("@id", this.id);
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        this.type = typeComboBox.Text = reader.GetString(0);
                        this.fee  = feeNumericUpDown.Value = reader.GetDecimal(1);
                        startDateTimePickerX.SelectedDateInDateTime = Convert.ToDateTime(String.Format("{0}", reader["startdate"])).Date;
                        enactmentTextbox.Text     = ExtensionFunction.EnglishToPersian(reader.GetString(4));
                        this.packets              = reader.GetInt32(2);
                        packetNumericUpDown.Value = Convert.ToDecimal(this.packets);
                        this.status         = reader.GetString(5);
                        this.metric         = reader.GetDecimal(6);
                        explainTextBox.Text = String.Format("{0}", reader["description"]);
                        this.subdate        = Convert.ToDateTime(String.Format("{0}", reader["subdate"])).Date;
                    }
                }
                if (this.status != "تعریف شده")
                {
                    delButton.Enabled = startDateTimePickerX.Enabled = packetNumericUpDown.Enabled = feeNumericUpDown.Enabled = false;
                }
                con.Close();
            }
        }
Ejemplo n.º 2
0
        private void otherHelpIndivPresentForm_Load(object sender, EventArgs e)
        {
            idTextBox.SelectionAlignment  = HorizontalAlignment.Center;
            mIdTextbox.SelectionAlignment = HorizontalAlignment.Center;
            feeTextBox.SelectionAlignment = HorizontalAlignment.Center;
            idTextBox.Text = ExtensionFunction.EnglishToPersian(this.id);
            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            SqlCommand cmdget;

            if (this.Text == "ارائه کمک متفرقه فردی")
            {
                feeTextBox.Visible = label3.Visible = true;
                cmdget             = new SqlCommand("select mId, OtherHelpsIndiv.description, OtherHelpIndivReq.description, fee, cashtype from OtherHelpsIndiv, OtherHelpIndivReq where OtherHelpsIndiv.reqId = OtherHelpIndivReq.id and OtherHelpsIndiv.id = @id;", con);
                cmdget.Parameters.AddWithValue("@id", this.id);
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        explainTextBox.Text = reader.GetString(2) + " " + reader.GetString(1);
                        this.mId            = reader.GetString(0); mIdTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
                        feeTextBox.Text     = ExtensionFunction.EnglishToPersian(Convert.ToUInt64(reader.GetDecimal(3)).ToString());
                        this.fee            = reader.GetDecimal(3);
                        this.cashtype       = reader.GetString(4);
                    }
                }
            }
            else
            {
                this.BackColor = Color.Yellow;
                visitPreReceiptButton.Visible = delButton.Visible = true;
                receiptLabel.BackColor        = Color.YellowGreen;
                label22.Location              = new Point(label22.Location.X, label22.Location.Y - 12);
                receiptLabel.Location         = new Point(receiptLabel.Location.X, receiptLabel.Location.Y - 12);
                receiptAddFileButton.Location = new Point(receiptAddFileButton.Location.X, receiptAddFileButton.Location.Y - 12);
                feeTextBox.Visible            = label3.Visible = true;
                cmdget = new SqlCommand("select mId, OtherHelpsIndiv.description, OtherHelpIndivReq.description, presdescription, fee, cashtype, bankAccountName, bankAccountId from OtherHelpsIndiv, OtherHelpIndivReq where OtherHelpsIndiv.reqId = OtherHelpIndivReq.id and OtherHelpsIndiv.id = @id;", con);
                cmdget.Parameters.AddWithValue("@id", this.id);
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        explainTextBox.Text           = reader.GetString(2) + " " + reader.GetString(1) + " " + reader.GetString(3); this.explain = reader.GetString(3);
                        this.mId                      = reader.GetString(0); mIdTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
                        feeTextBox.Text               = ExtensionFunction.EnglishToPersian(Convert.ToUInt64(reader.GetDecimal(4)).ToString());
                        this.fee                      = reader.GetDecimal(4);
                        this.cashtype                 = reader.GetString(5);
                        this.prebId                   = reader.GetString(7);
                        bankAccountNumberTextBox.Text = ExtensionFunction.EnglishToPersian(this.prebId);
                        bankAccountNameComboBox.Text  = reader.GetString(6);
                    }
                }
            }
            if (cashtype == "غیرنقدی")
            {
                bankAccountNameComboBox.Enabled = false;
            }
            con.Close();
        }
Ejemplo n.º 3
0
        private void bankAccountEditForm2_Load(object sender, EventArgs e)
        {
            enactmentTextbox.SelectionAlignment            = HorizontalAlignment.Center;
            bankAccountNameTextBox.SelectionAlignment      = HorizontalAlignment.Center;
            bankAccountNumberTextBox.SelectionAlignment    = HorizontalAlignment.Center;
            bankNameTextBox.SelectionAlignment             = HorizontalAlignment.Center;
            bankAccountOwnerNameTextBox.SelectionAlignment = HorizontalAlignment.Center;
            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            SqlCommand cmdget = new SqlCommand("select name, bankName, ownerName from bankAccount where id = @id;", con);

            cmdget.Parameters.AddWithValue("@id", this.id);
            using (SqlDataReader reader = cmdget.ExecuteReader())
            {
                if (reader.Read())
                {
                    bankAccountNumberTextBox.Text    = ExtensionFunction.EnglishToPersian(this.id);
                    bankAccountNameTextBox.Text      = reader.GetString(0);
                    bankNameTextBox.Text             = reader.GetString(1);
                    bankAccountOwnerNameTextBox.Text = reader.GetString(2);
                }
            }
            con.Close();
        }
Ejemplo n.º 4
0
        private void editHelperForm2_Load(object sender, EventArgs e)
        {
            idTextBox.SelectionAlignment      = HorizontalAlignment.Center;
            nameTextBox.SelectionAlignment    = HorizontalAlignment.Center;
            familyTextBox.SelectionAlignment  = HorizontalAlignment.Center;
            phoneTextBox.SelectionAlignment   = HorizontalAlignment.Center;
            addressTextBox.SelectionAlignment = HorizontalAlignment.Center;

            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            SqlCommand cmdget = new SqlCommand("select name, family, phone, address from helper where id = @id;", con);

            cmdget.Parameters.AddWithValue("@id", this.id);
            using (SqlDataReader reader = cmdget.ExecuteReader())
            {
                if (reader.Read())
                {
                    idTextBox.Text      = ExtensionFunction.EnglishToPersian(this.id);
                    nameTextBox.Text    = reader.GetString(0);
                    familyTextBox.Text  = reader.GetString(1);
                    phoneTextBox.Text   = ExtensionFunction.EnglishToPersian(reader.GetString(2));
                    addressTextBox.Text = ExtensionFunction.EnglishToPersian(reader.GetString(3));
                }
            }
            con.Close();
        }
Ejemplo n.º 5
0
 private void marryHelpReqForm_Load(object sender, EventArgs e)
 {
     idTextbox.SelectionAlignment = HorizontalAlignment.Center;
     if (this.Text == "ثبت درخواست کمک ازدواج")
     {
         idTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
     }
     else
     {
         this.BackColor          = Color.Yellow; delButton.Visible = true;
         marryDocLabel.BackColor = reqLabel.BackColor = Color.YellowGreen;
         SqlConnection con = new SqlConnection(this.connection);
         con.Open();
         SqlCommand cmdget = new SqlCommand("select mId, reqdate, description from MarryHelpReq where id = @id;", con);
         cmdget.Parameters.AddWithValue("@id", this.id);
         using (SqlDataReader reader = cmdget.ExecuteReader())
         {
             if (reader.Read())
             {
                 idTextbox.Text = reader.GetString(0);
                 reqDateTimePickerX.SelectedDateInDateTime = Convert.ToDateTime(String.Format("{0}", reader["reqdate"])).Date;
                 explainTextBox.Text = reader.GetString(2);
             }
         }
         con.Close();
     }
 }
Ejemplo n.º 6
0
        private void searchButton_Click(object sender, EventArgs e)
        {
            var newform = new searchEnactmentForm();

            newform.ShowDialog(this);
            if (newform.Text == "choose")
            {
                enactmentTextbox.Text = ExtensionFunction.EnglishToPersian(Clipboard.GetText());
            }
        }
Ejemplo n.º 7
0
        private void searchButton_Click(object sender, EventArgs e)
        {
            var newform = new searchForm("ویرایش اطلاعات مددکار");

            newform.ShowDialog(this);
            if (newform.Text.StartsWith("choose"))
            {
                idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
            }
        }
Ejemplo n.º 8
0
        private void searchButton_Click(object sender, EventArgs e)
        {
            var newform = new searchEnactmentForm();

            newform.ShowDialog(this);
            if (newform.Text.StartsWith("choose"))
            {
                enactmentTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
            }
        }
Ejemplo n.º 9
0
        private void searchApplicantButton_Click(object sender, EventArgs e)
        {
            var newform = new searchForm("تقاضا جدید متقاضی");

            newform.ShowDialog(this);
            if (newform.Text.StartsWith("choose"))
            {
                idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
                // ExtensionFunction.PersianToEnglish(idTextbox.Text);
            }
        }
Ejemplo n.º 10
0
        private void marrySendIntroForm_Load(object sender, EventArgs e)
        {
            idTextBox.SelectionAlignment = HorizontalAlignment.Center;
            idTextBox.Text = ExtensionFunction.EnglishToPersian(this.id);
            SqlConnection con = new SqlConnection(this.connection);
            SqlCommand    cmdget;

            con.Open();
            if (this.Text == "ارسال معرفی‌نامه جهیزیه")
            {
                cmdget = new SqlCommand("select reqId, MarryHelps.description, MarryHelps.enactmentId, MarryHelpReq.description from MarryHelps, MarryHelpReq where MarryHelps.reqId = MarryHelpReq.id and MarryHelps.id = @id;", con);
                cmdget.Parameters.AddWithValue("@id", this.id);
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        this.rId            = reader.GetString(0);
                        explainTextBox.Text = reader.GetString(3) + " " + reader.GetString(1);
                        this.eId            = reader.GetString(2);
                    }
                }
            }
            else
            {
                this.BackColor              = Color.Yellow; delButton.Visible = visitPreIntroButton.Visible = true;
                introLabel.BackColor        = Color.YellowGreen;
                label22.Location            = new Point(label22.Location.X, label22.Location.Y - 12);
                introLabel.Location         = new Point(introLabel.Location.X, introLabel.Location.Y - 12);
                introAddFileButton.Location = new Point(introAddFileButton.Location.X, introAddFileButton.Location.Y - 12);
                cmdget = new SqlCommand("select reqId, MarryHelps.description, MarryHelps.enactmentId, MarryHelpReq.description, introdescription from MarryHelps, MarryHelpReq where MarryHelps.reqId = MarryHelpReq.id and MarryHelps.id = @id;", con);
                cmdget.Parameters.AddWithValue("@id", this.id);
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        this.rId            = reader.GetString(0);
                        explainTextBox.Text = reader.GetString(3) + " " + reader.GetString(1) + " " + reader.GetString(4); this.explain = reader.GetString(4);
                        this.eId            = reader.GetString(2);
                    }
                }
            }

            cmdget = new SqlCommand("select docpath from enactment where id = @eId;", con);
            cmdget.Parameters.AddWithValue("@eId", this.eId);
            using (SqlDataReader reader = cmdget.ExecuteReader())
            {
                if (reader.Read())
                {
                    this.ePath = reader.GetString(0);
                }
            }
            con.Close();
        }
Ejemplo n.º 11
0
        private void searchButton_Click(object sender, EventArgs e)
        {
            var newform = new searchEnactmentForm();

            newform.ShowDialog(this);
            if (newform.Text.StartsWith("choose"))
            {
                enactmentTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
            }
            if (this.Text == "ویرایش تایید معرفی‌نامه تحصیلی")
            {
                setButton.Enabled = true;
            }
        }
Ejemplo n.º 12
0
        private void editBuyHelpsForm2_Load(object sender, EventArgs e)
        {
            typeComboBox.DropDownStyle                  = ComboBoxStyle.DropDownList;
            buyerNameTextBox.SelectionAlignment         = HorizontalAlignment.Center;
            bankAccountNumberTextBox.SelectionAlignment = HorizontalAlignment.Center;
            bankAccountNameComboBox.DropDownStyle       = ComboBoxStyle.DropDownList;
            enactmentTextbox.SelectionAlignment         = HorizontalAlignment.Center;
            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            SqlCommand cmdget = new SqlCommand("select id, name from bankAccount;", con);

            using (SqlDataReader reader = cmdget.ExecuteReader())
            {
                while (reader.Read())
                {
                    li.Add(new KeyValuePair <string, string>(reader.GetString(0), reader.GetString(1)));
                    bankAccountNameComboBox.Items.Add(reader.GetString(1));
                }
            }
            cmdget = new SqlCommand("select type, fee, packet, buyerName, buydate, bankAccountId ,bankAccountName, description from buyHelps where id = @id;", con);
            cmdget.Parameters.AddWithValue("@id", this.id);
            using (SqlDataReader reader = cmdget.ExecuteReader())
            {
                if (reader.Read())
                {
                    pretype     = typeComboBox.Text = reader.GetString(0);
                    this.preFee = feeNumericUpDown.Value = reader.GetDecimal(1);
                    packetNumericUpDown.Value = reader.GetInt32(2);
                    buyerNameTextBox.Text     = reader.GetString(3);
                    buyDateTimePickerX.SelectedDateInDateTime = Convert.ToDateTime(String.Format("{0}", reader["buydate"])).Date;
                    bankAccountNumberTextBox.Text             = ExtensionFunction.EnglishToPersian(reader.GetString(5));
                    this.prebId = reader.GetString(5);
                    bankAccountNameComboBox.Text = reader.GetString(6);
                    explainTextBox.Text          = reader.GetString(7);
                }
            }
            cmdget = new SqlCommand("select docpath from doc where id = @id;", con);
            cmdget.Parameters.AddWithValue("@id", this.id);
            using (SqlDataReader reader = cmdget.ExecuteReader())
            {
                if (reader.Read())
                {
                    preFile = reader.GetString(0);
                }
            }
            con.Close();
        }
Ejemplo n.º 13
0
 private void searchButton_Click(object sender, EventArgs e)
 {
     if (this.Text == "بررسی تقاضا" || this.Text == "ویرایش تقاضا")
     {
         var newform = new searchForm("ویرایش تقاضا");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));;
         }
     }
     else if (this.Text == "ثبت ارائه معرفی‌نامه" || this.Text == "ویرایش بررسی")
     {
         searchForm newform;
         if (this.Text == "ویرایش بررسی")
         {
             newform = new searchForm("ویرایش بررسی");
         }
         else
         {
             newform = new searchForm("ثبت ارائه معرفی‌نامه");
         }
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));;
         }
     }
     else if (this.Text == "ویرایش مصوبه")
     {
         var newform = new searchForm("ویرایش مصوبه");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));;
         }
     }
     else
     {
         var newform = new searchForm("ویرایش ارائه معرفی‌نامه");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));;
         }
     }
 }
Ejemplo n.º 14
0
        private void searchButton_Click(object sender, EventArgs e)
        {
            searchForm newform;

            if (this.Text == "ویرایش متقاضی")
            {
                newform = new searchForm("متقاضی سایر");
            }
            else
            {
                newform = new searchForm("متقاضی");
            }
            newform.ShowDialog(this);
            if (newform.Text.StartsWith("choose"))
            {
                idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));;
            }
        }
Ejemplo n.º 15
0
 private void searchButton_Click(object sender, EventArgs e)
 {
     if (this.typ == "خانوار")
     {
         var newform = new searchForm("انتخاب خانوار");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else
     {
         var newform = new searchForm("ویرایش عضو");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
 }
        private void otherHelpIndivConfirmForm_Load(object sender, EventArgs e)
        {
            enactmentTextbox.SelectionAlignment = HorizontalAlignment.Center;
            visitButton.Enabled = false;
            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            if (this.Text == "تایید کمک متفرقه فردی")
            {
                SqlCommand cmdgetgrid = new SqlCommand("select OtherHelpsIndiv.id as 'شماره کمک', mId as 'شماره ملی مددجو', reqId as 'شماره درخواست', OtherHelpsIndiv.status as 'وضعیت کمک', OtherHelpIndivReq.status as 'وضعیت درخواست', OtherHelpsIndiv.enactmentId as 'شماره مصوبه', dbo.MiladiTOShamsi(OtherHelpIndivReq.reqdate) as 'تاریخ ثبت درخواست', dbo.MiladiTOShamsi(OtherHelpsIndiv.subdate) as 'تاریخ بررسی و ثبت کمک', dbo.MiladiTOShamsi(OtherHelpsIndiv.enddate) as 'تاریخ ارائه' from OtherHelpsIndiv, OtherHelpIndivReq where OtherHelpsIndiv.reqId = OtherHelpIndivReq.id and OtherHelpsIndiv.id = @id;", con);
                cmdgetgrid.Parameters.AddWithValue("@id", this.id);
                SqlDataAdapter da = new SqlDataAdapter(cmdgetgrid);
                DataTable      dt = new DataTable();
                da.Fill(dt);
                membersView.DataSource = dt;
                climit = 5;
                SqlCommand cmdget = new SqlCommand("select reqId, OtherHelpsIndiv.description, OtherHelpIndivReq.description, presdescription, fee, OtherHelpsIndiv.enactmentId, mId from OtherHelpsIndiv, OtherHelpIndivReq where OtherHelpsIndiv.reqId = OtherHelpIndivReq.id and OtherHelpsIndiv.id = @id;", con);
                cmdget.Parameters.AddWithValue("@id", this.id);
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        this.rId            = reader.GetString(0);
                        explainTextBox.Text = reader.GetString(2) + " " + reader.GetString(1) + " " + reader.GetString(3);
                        this.fee            = feeNumericUpDown.Value = reader.GetDecimal(4);
                        this.eId            = reader.GetString(5);
                        this.mId            = reader.GetString(6);
                    }
                }
                SqlCommand cmdget2 = new SqlCommand("select docpath from enactment where id = @eId;", con);
                cmdget2.Parameters.AddWithValue("@eId", this.eId);
                using (SqlDataReader reader = cmdget2.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        this.ePath = reader.GetString(0);
                    }
                }
            }
            else
            {
                this.BackColor = Color.Yellow;
                membersView.BackgroundColor = Color.Gold;
                SqlCommand cmdgetgrid = new SqlCommand("select OtherHelpsIndiv.id as 'شماره کمک', mId as 'شماره ملی مددجو', reqId as 'شماره درخواست', OtherHelpsIndiv.status as 'وضعیت کمک', OtherHelpIndivReq.status as 'وضعیت درخواست', OtherHelpsIndiv.enactmentId as 'شماره مصوبه', OtherHelpsIndiv.fenactmentId as 'شماره مصوبه پایانی', dbo.MiladiTOShamsi(OtherHelpIndivReq.reqdate) as 'تاریخ ثبت درخواست', dbo.MiladiTOShamsi(OtherHelpsIndiv.subdate) as 'تاریخ بررسی و ثبت کمک', dbo.MiladiTOShamsi(OtherHelpsIndiv.enddate) as 'تاریخ ارائه', dbo.MiladiTOShamsi(OtherHelpsIndiv.confirmdate) as 'تاریخ تایید' from OtherHelpsIndiv, OtherHelpIndivReq where OtherHelpsIndiv.reqId = OtherHelpIndivReq.id and OtherHelpsIndiv.id = @id;", con);
                cmdgetgrid.Parameters.AddWithValue("@id", this.id);
                SqlDataAdapter da = new SqlDataAdapter(cmdgetgrid);
                DataTable      dt = new DataTable();
                da.Fill(dt);
                membersView.DataSource = dt;
                climit = 6;
                SqlCommand cmdget = new SqlCommand("select reqId, OtherHelpsIndiv.description, OtherHelpIndivReq.description, presdescription, fee, OtherHelpsIndiv.enactmentId, confirmdescription, fenactmentId, mId from OtherHelpsIndiv, OtherHelpIndivReq where OtherHelpsIndiv.reqId = OtherHelpIndivReq.id and OtherHelpsIndiv.id = @id;", con);
                cmdget.Parameters.AddWithValue("@id", this.id);
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        this.rId            = reader.GetString(0);
                        explainTextBox.Text = reader.GetString(2) + " " + reader.GetString(1) + " " + reader.GetString(3) + " " + reader.GetString(6); this.explain = reader.GetString(6);
                        this.fee            = feeNumericUpDown.Value = reader.GetDecimal(4);
                        this.eId            = reader.GetString(5);
                        this.eId2           = reader.GetString(7); enactmentTextbox.Text = ExtensionFunction.EnglishToPersian(this.eId2);
                        this.mId            = reader.GetString(8);
                    }
                }
                SqlCommand cmdget2 = new SqlCommand("select docpath from enactment where id = @eId;", con);
                cmdget2.Parameters.AddWithValue("@eId", this.eId);
                using (SqlDataReader reader = cmdget2.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        this.ePath = reader.GetString(0);
                    }
                }
                cmdget2 = new SqlCommand("select docpath from enactment where id = @eId;", con);
                cmdget2.Parameters.AddWithValue("@eId", this.eId2);
                using (SqlDataReader reader = cmdget2.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        this.ePath2 = reader.GetString(0);
                    }
                }
            }
            con.Close();
        }
Ejemplo n.º 17
0
        private void setButton_Click(object sender, EventArgs e)
        {
            if (this.Text == "ارائه کمک متفرقه فردی")
            {
                if (receiptLabel.BackColor == Color.Red)
                {
                    FMessegeBox.FarsiMessegeBox.Show("فیش پرداخت بارگزاری نشده است!", "خطا!", FMessegeBox.FMessegeBoxButtons.Ok, FMessegeBox.FMessegeBoxIcons.Error, FMessegeBox.FMessegeBoxDefaultButton.button1);
                    return;
                }
                SqlConnection con = new SqlConnection(this.connection);
                con.Open();

                if (cashtype == "نقدی")
                {
                    decimal    stock  = 0;
                    SqlCommand cmdget = new SqlCommand("select stock from bankAccount where id = @bId;", con);
                    cmdget.Parameters.AddWithValue("@bId", ExtensionFunction.PersianToEnglish(bankAccountNumberTextBox.Text));
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            stock = reader.GetDecimal(0);
                        }
                    }
                    if (stock < fee)
                    {
                        FMessegeBox.FarsiMessegeBox.Show("موجودی کافی نیست!", "خطا!", FMessegeBox.FMessegeBoxButtons.Ok, FMessegeBox.FMessegeBoxIcons.Error, FMessegeBox.FMessegeBoxDefaultButton.button1);
                        return;
                    }
                    DialogResult res = FMessegeBox.FarsiMessegeBox.Show("آیا نسیت به ثبت ارائه این کمک اطمینان دارید؟", "پرسش", FMessegeBox.FMessegeBoxButtons.YesNo, FMessegeBox.FMessegeBoxIcons.Question, FMessegeBox.FMessegeBoxDefaultButton.button1);
                    if (res != DialogResult.Yes)
                    {
                        return;
                    }
                    string fileName   = System.IO.Path.GetFileName(RF);
                    string targetPath = this.helpPath + "\\" + this.id + "\\receipt";
                    string destFile   = System.IO.Path.Combine(targetPath, fileName);
                    System.IO.File.Copy(addOpenFileDialog.FileName, destFile, false);
                    SqlCommand cmd = new SqlCommand("BEGIN TRY begin tran t1; update OtherHelpsIndiv Set presdescription = @des, enddate = @edate, status = @stat where id = @id; update bankAccount set stock = @st where id = @bId; insert into doc(id, docname, docpath, subdate, doctype) Values (@id, @dname, @dpath, @edate, @dtype); commit tran t1; END TRY BEGIN CATCH ROLLBACK END CATCH", con);
                    cmd.Parameters.AddWithValue("@id", this.id);
                    cmd.Parameters.AddWithValue("@des", "(توضیحات ارائه: " + explainTextBox2.Text + ")");
                    cmd.Parameters.AddWithValue("@edate", DateTime.Now.Date);
                    cmd.Parameters.AddWithValue("@stat", "پایان‌یافته: ارائه شده");
                    cmd.Parameters.AddWithValue("@bId", ExtensionFunction.PersianToEnglish(bankAccountNumberTextBox.Text));
                    cmd.Parameters.AddWithValue("@st", stock + fee);
                    cmd.Parameters.AddWithValue("@dname", fileName);
                    cmd.Parameters.AddWithValue("@dpath", destFile);
                    cmd.Parameters.AddWithValue("@dtype", "OIhelp:receipt");
                    cmd.ExecuteNonQuery();
                }
                else
                {
                    DialogResult res = FMessegeBox.FarsiMessegeBox.Show("آیا نسیت به ثبت ارائه این کمک اطمینان دارید؟", "پرسش", FMessegeBox.FMessegeBoxButtons.YesNo, FMessegeBox.FMessegeBoxIcons.Question, FMessegeBox.FMessegeBoxDefaultButton.button1);
                    if (res != DialogResult.Yes)
                    {
                        return;
                    }
                    string fileName   = System.IO.Path.GetFileName(RF);
                    string targetPath = this.helpPath + "\\" + this.id + "\\receipt";
                    string destFile   = System.IO.Path.Combine(targetPath, fileName);
                    System.IO.File.Copy(addOpenFileDialog.FileName, destFile, false);
                    SqlCommand cmd = new SqlCommand("BEGIN TRY begin tran t1; update OtherHelpsIndiv Set presdescription = @des, enddate = @edate, status = @stat where id = @id; insert into doc(id, docname, docpath, subdate, doctype) Values (@id, @dname, @dpath, @edate, @dtype); commit tran t1; END TRY BEGIN CATCH ROLLBACK END CATCH", con);
                    cmd.Parameters.AddWithValue("@id", this.id);
                    cmd.Parameters.AddWithValue("@des", "(توضیحات ارائه: " + explainTextBox2.Text + ")");
                    cmd.Parameters.AddWithValue("@edate", DateTime.Now.Date);
                    cmd.Parameters.AddWithValue("@stat", "پایان‌یافته: ارائه شده");
                    cmd.Parameters.AddWithValue("@dname", fileName);
                    cmd.Parameters.AddWithValue("@dpath", destFile);
                    cmd.Parameters.AddWithValue("@dtype", "OIhelp:receipt");
                    cmd.ExecuteNonQuery();
                }

                con.Close();
                FMessegeBox.FarsiMessegeBox.Show("کمک با موفقیت به مددجو ارائه شد!", "تبریک!", FMessegeBox.FMessegeBoxButtons.Ok, FMessegeBox.FMessegeBoxIcons.Information, FMessegeBox.FMessegeBoxDefaultButton.button1);
                this.Close();
            }
            else
            {
                SqlConnection con = new SqlConnection(this.connection);
                con.Open();
                if (cashtype == "نقدی")
                {
                    if (this.prebId != bankAccountNumberTextBox.Text)
                    {
                        decimal    stock = 0, prestock = 0;
                        SqlCommand cmdget = new SqlCommand("select stock from bankAccount where id = @bId;", con);
                        cmdget.Parameters.AddWithValue("@bId", ExtensionFunction.PersianToEnglish(bankAccountNumberTextBox.Text));
                        using (SqlDataReader reader = cmdget.ExecuteReader())
                        {
                            if (reader.Read())
                            {
                                stock = reader.GetDecimal(0);
                            }
                        }
                        cmdget = new SqlCommand("select stock from bankAccount where id = @bId;", con);
                        cmdget.Parameters.AddWithValue("@bId", this.prebId);
                        using (SqlDataReader reader = cmdget.ExecuteReader())
                        {
                            if (reader.Read())
                            {
                                prestock = reader.GetDecimal(0);
                            }
                        }
                        if (stock < fee)
                        {
                            FMessegeBox.FarsiMessegeBox.Show("موجودی کافی نیست!", "خطا!", FMessegeBox.FMessegeBoxButtons.Ok, FMessegeBox.FMessegeBoxIcons.Error, FMessegeBox.FMessegeBoxDefaultButton.button1);
                            return;
                        }
                        DialogResult res = FMessegeBox.FarsiMessegeBox.Show("آیا نسیت به ویرایش ارائه این کمک اطمینان دارید؟", "پرسش", FMessegeBox.FMessegeBoxButtons.YesNo, FMessegeBox.FMessegeBoxIcons.Question, FMessegeBox.FMessegeBoxDefaultButton.button1);
                        if (res != DialogResult.Yes)
                        {
                            return;
                        }
                        SqlCommand cmdu = new SqlCommand("BEGIN TRY begin tran t1; update bankAccount set stock = @st where id = @prev; update bankAccount set stock = @newst where id = @id; commit tran t1; END TRY BEGIN CATCH ROLLBACK END CATCH", con);
                        cmdu.Parameters.AddWithValue("@prev", this.prebId);
                        cmdu.Parameters.AddWithValue("@st", prestock + fee);
                        cmdu.Parameters.AddWithValue("@id", ExtensionFunction.PersianToEnglish(bankAccountNumberTextBox.Text));
                        cmdu.Parameters.AddWithValue("@newst", stock - fee);
                        cmdu.ExecuteNonQuery();
                        if (receiptLabel.BackColor == Color.GreenYellow)
                        {
                            string dpath = System.IO.Directory.GetFiles(this.helpPath + "\\" + this.id + "\\receipt")[0];
                            System.IO.File.Delete(dpath);
                            string fileName   = System.IO.Path.GetFileName(RF);
                            string targetPath = this.helpPath + "\\" + this.id + "\\receipt";
                            string destFile   = System.IO.Path.Combine(targetPath, fileName);
                            System.IO.File.Copy(addOpenFileDialog.FileName, destFile, false);
                            SqlCommand cmd = new SqlCommand("BEGIN TRY begin tran t1; update OtherHelpsIndiv Set presdescription = @des, bankAccountName = @bName, bankAccountId = @bId where id = @id; update doc Set docname = @dname, docpath = @dpath, subdate = @edate where id = @id and doctype = @dtype; commit tran t1; END TRY BEGIN CATCH ROLLBACK END CATCH", con);
                            cmd.Parameters.AddWithValue("@id", this.id);
                            cmd.Parameters.AddWithValue("@des", this.explain + "(توضیحات ویرایش ارائه: " + explainTextBox2.Text + ")");
                            cmd.Parameters.AddWithValue("@edate", DateTime.Now.Date);
                            cmd.Parameters.AddWithValue("@bName", bankAccountNameComboBox.Text);
                            cmd.Parameters.AddWithValue("@bId", ExtensionFunction.PersianToEnglish(bankAccountNumberTextBox.Text));
                            cmd.Parameters.AddWithValue("@dname", fileName);
                            cmd.Parameters.AddWithValue("@dpath", destFile);
                            cmd.Parameters.AddWithValue("@dtype", "OIhelp:receipt");
                            cmd.ExecuteNonQuery();
                        }
                        else
                        {
                            SqlCommand cmd = new SqlCommand("update OtherHelpsIndiv Set presdescription = @des, bankAccountName = @bName, bankAccountId = @bId where id = @id;", con);
                            cmd.Parameters.AddWithValue("@id", this.id);
                            cmd.Parameters.AddWithValue("@bName", bankAccountNameComboBox.Text);
                            cmd.Parameters.AddWithValue("@bId", ExtensionFunction.EnglishToPersian(bankAccountNumberTextBox.Text));
                            cmd.Parameters.AddWithValue("@des", this.explain + "(توضیحات ویرایش ارائه: " + explainTextBox2.Text + ")");
                            cmd.ExecuteNonQuery();
                        }
                    }
                    else
                    {
                        DialogResult res = FMessegeBox.FarsiMessegeBox.Show("آیا نسیت به ویرایش ارائه این کمک اطمینان دارید؟", "پرسش", FMessegeBox.FMessegeBoxButtons.YesNo, FMessegeBox.FMessegeBoxIcons.Question, FMessegeBox.FMessegeBoxDefaultButton.button1);
                        if (res != DialogResult.Yes)
                        {
                            return;
                        }
                        if (receiptLabel.BackColor == Color.GreenYellow)
                        {
                            string dpath = System.IO.Directory.GetFiles(this.helpPath + "\\" + this.id + "\\receipt")[0];
                            System.IO.File.Delete(dpath);
                            string fileName   = System.IO.Path.GetFileName(RF);
                            string targetPath = this.helpPath + "\\" + this.id + "\\receipt";
                            string destFile   = System.IO.Path.Combine(targetPath, fileName);
                            System.IO.File.Copy(addOpenFileDialog.FileName, destFile, false);
                            SqlCommand cmd = new SqlCommand("BEGIN TRY begin tran t1; update OtherHelpsIndiv Set presdescription = @des where id = @id; update doc Set docname = @dname, docpath = @dpath, subdate = @edate where id = @id and doctype = @dtype; commit tran t1; END TRY BEGIN CATCH ROLLBACK END CATCH", con);
                            cmd.Parameters.AddWithValue("@id", this.id);
                            cmd.Parameters.AddWithValue("@des", this.explain + "(توضیحات ویرایش ارائه: " + explainTextBox2.Text + ")");
                            cmd.Parameters.AddWithValue("@edate", DateTime.Now.Date);
                            cmd.Parameters.AddWithValue("@dname", fileName);
                            cmd.Parameters.AddWithValue("@dpath", destFile);
                            cmd.Parameters.AddWithValue("@dtype", "OIhelp:receipt");
                            cmd.ExecuteNonQuery();
                        }
                        else
                        {
                            SqlCommand cmd = new SqlCommand("update OtherHelpsIndiv Set presdescription = @des where id = @id;", con);
                            cmd.Parameters.AddWithValue("@id", this.id);
                            cmd.Parameters.AddWithValue("@des", this.explain + "(توضیحات ویرایش ارائه: " + explainTextBox2.Text + ")");
                            cmd.ExecuteNonQuery();
                        }
                    }
                }
                else
                {
                    if (receiptLabel.BackColor == Color.GreenYellow)
                    {
                        string dpath = System.IO.Directory.GetFiles(this.helpPath + "\\" + this.id + "\\receipt")[0];
                        System.IO.File.Delete(dpath);
                        string fileName   = System.IO.Path.GetFileName(RF);
                        string targetPath = this.helpPath + "\\" + this.id + "\\receipt";
                        string destFile   = System.IO.Path.Combine(targetPath, fileName);
                        System.IO.File.Copy(addOpenFileDialog.FileName, destFile, false);
                        SqlCommand cmd = new SqlCommand("BEGIN TRY begin tran t1; update OtherHelpsIndiv Set presdescription = @des where id = @id; update doc Set docname = @dname, docpath = @dpath, subdate = @edate where id = @id and doctype = @dtype; commit tran t1; END TRY BEGIN CATCH ROLLBACK END CATCH", con);
                        cmd.Parameters.AddWithValue("@id", this.id);
                        cmd.Parameters.AddWithValue("@des", this.explain + "(توضیحات ویرایش ارائه: " + explainTextBox2.Text + ")");
                        cmd.Parameters.AddWithValue("@edate", DateTime.Now.Date);
                        cmd.Parameters.AddWithValue("@dname", fileName);
                        cmd.Parameters.AddWithValue("@dpath", destFile);
                        cmd.Parameters.AddWithValue("@dtype", "OIhelp:receipt");
                        cmd.ExecuteNonQuery();
                    }
                    else
                    {
                        SqlCommand cmd = new SqlCommand("update OtherHelpsIndiv Set presdescription = @des where id = @id;", con);
                        cmd.Parameters.AddWithValue("@id", this.id);
                        cmd.Parameters.AddWithValue("@des", this.explain + "(توضیحات ویرایش ارائه: " + explainTextBox2.Text + ")");
                        cmd.ExecuteNonQuery();
                    }
                }

                con.Close();
                FMessegeBox.FarsiMessegeBox.Show("ارائه کمک با موفقیت ویرایش شد!", "تبریک!", FMessegeBox.FMessegeBoxButtons.Ok, FMessegeBox.FMessegeBoxIcons.Information, FMessegeBox.FMessegeBoxDefaultButton.button1);
                this.Close();
            }
        }
Ejemplo n.º 18
0
        private void marryHelpPresentForm_Load(object sender, EventArgs e)
        {
            idTextBox.SelectionAlignment                = HorizontalAlignment.Center;
            mIdTextbox.SelectionAlignment               = HorizontalAlignment.Center;
            feeTextBox.SelectionAlignment               = HorizontalAlignment.Center;
            bankAccountNameComboBox.DropDownStyle       = ComboBoxStyle.DropDownList;
            bankAccountNumberTextBox.SelectionAlignment = HorizontalAlignment.Center;
            idTextBox.Text = ExtensionFunction.EnglishToPersian(this.id);
            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            SqlCommand cmdget = new SqlCommand("select id, name from bankAccount;", con);

            using (SqlDataReader reader = cmdget.ExecuteReader())
            {
                while (reader.Read())
                {
                    li.Add(new KeyValuePair <string, string>(reader.GetString(0), reader.GetString(1)));
                    bankAccountNameComboBox.Items.Add(reader.GetString(1));
                }
            }
            if (this.Text == "ارائه کمک ازدواج")
            {
                if (type == "نقدی")
                {
                    visitAssignmentButton.Visible = false;
                    feeTextBox.Visible            = label3.Visible = true;
                    cmdget = new SqlCommand("select mId, MarryHelps.description, MarryHelpReq.description, fee from MarryHelps, MarryHelpReq where MarryHelps.reqId = MarryHelpReq.id and MarryHelps.id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.id);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            explainTextBox.Text = reader.GetString(2) + " " + reader.GetString(1);
                            this.mId            = reader.GetString(0); mIdTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
                            feeTextBox.Text     = ExtensionFunction.EnglishToPersian(Convert.ToUInt64(reader.GetDecimal(3)).ToString());
                        }
                    }
                }
                else
                {
                    bankAccountNameComboBox.Enabled = false;
                    cmdget = new SqlCommand("select mId, MarryHelps.description, MarryHelpReq.description, introdescription, resdescription from MarryHelps, MarryHelpReq where MarryHelps.reqId = MarryHelpReq.id and MarryHelps.id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.id);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            explainTextBox.Text = reader.GetString(2) + " " + reader.GetString(1) + " " + reader.GetString(3) + " " + reader.GetString(4);
                            this.mId            = reader.GetString(0); mIdTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
                        }
                    }
                }
            }
            else
            {
                this.BackColor = Color.Yellow;
                visitPreReceiptButton.Visible = delButton.Visible = true;
                receiptLabel.BackColor        = Color.YellowGreen;
                label22.Location              = new Point(label22.Location.X, label22.Location.Y - 12);
                receiptLabel.Location         = new Point(receiptLabel.Location.X, receiptLabel.Location.Y - 12);
                receiptAddFileButton.Location = new Point(receiptAddFileButton.Location.X, receiptAddFileButton.Location.Y - 12);

                if (type == "نقدی")
                {
                    visitAssignmentButton.Visible = false;
                    feeTextBox.Visible            = label3.Visible = true;
                    cmdget = new SqlCommand("select mId, MarryHelps.description, MarryHelpReq.description, presdescription, fee, bankAccountName, bankAccountId from MarryHelps, MarryHelpReq where MarryHelps.reqId = MarryHelpReq.id and MarryHelps.id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.id);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            explainTextBox.Text           = reader.GetString(2) + " " + reader.GetString(1) + " " + reader.GetString(3); this.explain = reader.GetString(3);
                            this.mId                      = reader.GetString(0); mIdTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
                            feeTextBox.Text               = ExtensionFunction.EnglishToPersian(Convert.ToUInt64(reader.GetDecimal(4)).ToString());
                            this.fee                      = reader.GetDecimal(4);
                            this.prebId                   = reader.GetString(6);
                            bankAccountNameComboBox.Text  = reader.GetString(5);
                            bankAccountNumberTextBox.Text = ExtensionFunction.EnglishToPersian(this.prebId);
                        }
                    }
                    int        c        = 0;
                    SqlCommand cmdcheck = new SqlCommand("select count(*) from bankAccount where id = @id;", con);
                    cmdcheck.Parameters.AddWithValue("@id", this.prebId);
                    using (SqlDataReader reader = cmdcheck.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            c = reader.GetInt32(0);
                        }
                    }
                    if (c == 0)
                    {
                        bankAccountNameComboBox.Text   += "(حذف شده)";
                        bankAccountNameComboBox.Enabled = false;
                        delButton.Enabled = false;
                    }
                }
                else
                {
                    bankAccountNameComboBox.Enabled = false;
                    cmdget = new SqlCommand("select mId, MarryHelps.description, MarryHelpReq.description, introdescription, resdescription, presdescription from MarryHelps, MarryHelpReq where MarryHelps.reqId = MarryHelpReq.id and MarryHelps.id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.id);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            explainTextBox.Text = reader.GetString(2) + " " + reader.GetString(1) + " " + reader.GetString(3) + " " + reader.GetString(4) + " " + reader.GetString(5); this.explain = reader.GetString(5);
                            this.mId            = reader.GetString(0); mIdTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
                        }
                    }
                }
            }
            con.Close();
        }
Ejemplo n.º 19
0
        private void recHelpsEditForm2_Load(object sender, EventArgs e)
        {
            typeTextBox.SelectionAlignment              = HorizontalAlignment.Center;
            helperIdTextbox.SelectionAlignment          = HorizontalAlignment.Center;
            helperNameTextBox.SelectionAlignment        = HorizontalAlignment.Center;
            bankAccountNumberTextBox.SelectionAlignment = HorizontalAlignment.Center;
            bankAccountNameComboBox.DropDownStyle       = ComboBoxStyle.DropDownList;
            enactmentTextbox.SelectionAlignment         = HorizontalAlignment.Center;
            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            SqlCommand cmdget = new SqlCommand("select id, name from bankAccount;", con);

            using (SqlDataReader reader = cmdget.ExecuteReader())
            {
                while (reader.Read())
                {
                    li.Add(new KeyValuePair <string, string>(reader.GetString(0), reader.GetString(1)));
                    bankAccountNameComboBox.Items.Add(reader.GetString(1));
                }
            }
            cmdget = new SqlCommand("select type, fee, packet, helperId, helperName, recdate, bankAccountId ,bankAccountName, description, cashtype from recHelps where id = @id;", con);
            cmdget.Parameters.AddWithValue("@id", this.id);
            using (SqlDataReader reader = cmdget.ExecuteReader())
            {
                if (reader.Read())
                {
                    typeTextBox.Text          = reader.GetString(0);
                    this.preFee               = feeNumericUpDown.Value = reader.GetDecimal(1);
                    packetNumericUpDown.Value = reader.GetInt32(2);
                    helperIdTextbox.Text      = ExtensionFunction.EnglishToPersian(reader.GetString(3));
                    helperNameTextBox.Text    = reader.GetString(4);
                    recDateTimePickerX.SelectedDateInDateTime = Convert.ToDateTime(String.Format("{0}", reader["recdate"])).Date;
                    bankAccountNumberTextBox.Text             = ExtensionFunction.EnglishToPersian(reader.GetString(6));
                    this.prebId = reader.GetString(6);
                    bankAccountNameComboBox.Text = reader.GetString(7);
                    explainTextBox.Text          = reader.GetString(8);
                    if (reader.GetString(9) == "نقدی")
                    {
                        cashRadioButton.Checked = true;
                        this.precashtype        = "نقدی";
                    }
                    else
                    {
                        nonCashRadioButton.Checked            = true;
                        this.precashtype                      = "غیرنقدی";
                        bankAccountNameComboBox.SelectedIndex = -1;
                        bankAccountNumberTextBox.Text         = "";
                    }
                }
            }
            cmdget = new SqlCommand("select docpath from doc where id = @id;", con);
            cmdget.Parameters.AddWithValue("@id", this.id);
            using (SqlDataReader reader = cmdget.ExecuteReader())
            {
                if (reader.Read())
                {
                    preFile = reader.GetString(0);
                }
            }
            SqlCommand cmdcheck = new SqlCommand("select count(*) from bankAccount where id = @id;", con);

            cmdcheck.Parameters.AddWithValue("@id", this.prebId);
            int c = 0;

            using (SqlDataReader reader = cmdcheck.ExecuteReader())
            {
                if (reader.Read())
                {
                    c = reader.GetInt32(0);
                }
            }
            if (c == 0)
            {
                bankAccountNameComboBox.Enabled = false;
                bankAccountNameComboBox.Text   += "(حذف شده)";
                feeNumericUpDown.Enabled        = false;
                typeGroupBox.Enabled            = cashRadioButton.Enabled = nonCashRadioButton.Enabled = false;
            }
            con.Close();
        }
Ejemplo n.º 20
0
        private void helpPresentationEduIntroductionForm_Load(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            if (this.Text == "ارائه معرفی‌نامه تحصیلی")
            {
                visitButton.Enabled = delButton.Enabled = false;
                setButton.Enabled   = memberDataGridView.RowCount != 0;
            }
            else if (this.Text == "ویرایش فایل‌های معرفی‌نامه تحصیلی")
            {
                setButton.Enabled    = false;
                returnButton.Visible = true;
            }
            else if (this.Text == "تایید معرفی‌نامه تحصیلی" || this.Text == "ویرایش تایید معرفی‌نامه تحصیلی")
            {
                setButton.Enabled = visitButton.Enabled = false;
                enactmentTextbox.SelectionAlignment  = HorizontalAlignment.Center;
                enactmentTextbox2.SelectionAlignment = HorizontalAlignment.Center;
                delButton.Visible        = addButton.Visible = false;
                feeNumericUpDown.Visible = label23.Visible = label8.Visible = label4.Visible = searchButton.Visible = enactmentTextbox.Visible = enactmentTextbox2.Visible = true;
                setButton.Text           = "تایید";
                SqlCommand cmdget = new SqlCommand("select enactmentId, fee from StudyHelps where id = @id;", con);
                cmdget.Parameters.AddWithValue("@id", this.id);
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        enactmentTextbox.Text  = ExtensionFunction.EnglishToPersian(reader.GetString(0));
                        feeNumericUpDown.Value = this.fee = reader.GetDecimal(1);
                    }
                }
                if (this.Text == "ویرایش تایید معرفی‌نامه تحصیلی")
                {
                    cmdget = new SqlCommand("select fenactmentId from StudyHelps where id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.id);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            enactmentTextbox2.Text = ExtensionFunction.EnglishToPersian(reader.GetString(0));
                        }
                    }
                }
            }
            SqlCommand     cmd;
            SqlDataAdapter da; DataTable dt;

            cmd = new SqlCommand("select i, docname as 'نام مدرک', dbo.MiladiTOShamsi(subdate) as 'تاریخ افزودن مدرک', docpath from doc where id = @id and doctype = @dtype;", con);
            cmd.Parameters.AddWithValue("@id", this.id);
            cmd.Parameters.AddWithValue("@dtype", "Shelp");
            da = new SqlDataAdapter(cmd);
            dt = new DataTable();
            da.Fill(dt);
            memberDataGridView.DataSource         = dt;
            memberDataGridView.Columns[0].Visible = memberDataGridView.Columns[3].Visible = false;
            if (this.Text == "ارائه معرفی‌نامه تحصیلی")
            {
                cmd = new SqlCommand("select stuId as 'شماره ملی', name as 'نام', family as 'نام خانوادگی', supporter_id as 'شماره ملی سرپرست', folder_id as 'شماره پرونده' from StudyFinList where hId = @hId;", con);
            }
            else
            {
                cmd = new SqlCommand("select stuId as 'شماره ملی', name as 'نام', family as 'نام خانوادگی', supporter_id as 'شماره ملی سرپرست', folder_id as 'شماره پرونده' from StudyRecList where hId = @hId;", con);
            }
            cmd.Parameters.AddWithValue("@hId", this.id);
            da = new SqlDataAdapter(cmd);
            dt = new DataTable();
            da.Fill(dt);
            recDataGridView.DataSource = dt;
            con.Close();
        }
Ejemplo n.º 21
0
        private void marryResForm_Load(object sender, EventArgs e)
        {
            idTextBox.SelectionAlignment = HorizontalAlignment.Center;
            idTextBox.Text = ExtensionFunction.EnglishToPersian(this.id);
            SqlConnection con = new SqlConnection(this.connection);
            SqlCommand    cmdget;

            con.Open();
            if (this.Text == "دریافت نتیجه معرفی‌نامه جهیزیه")
            {
                cmdget = new SqlCommand("select reqId, MarryHelps.description, MarryHelpReq.description, introdescription, fee from MarryHelps, MarryHelpReq where MarryHelps.reqId = MarryHelpReq.id and MarryHelps.id = @id;", con);
                cmdget.Parameters.AddWithValue("@id", this.id);
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        explainTextBox.Text = reader.GetString(2) + " " + reader.GetString(1) + " " + reader.GetString(3);
                        this.fee            = feeNumericUpDown.Value = reader.GetDecimal(4);
                        this.rId            = reader.GetString(0);
                    }
                }
            }
            else
            {
                this.BackColor = Color.Yellow; delButton.Visible = true; denyButton.Visible = false;
                if (rad)
                {
                    setButton.Text           = "لغو ویرایش";
                    feeNumericUpDown.Enabled = explainTextBox2.Enabled = assignmentAddFileButton.Enabled = false;
                    cmdget = new SqlCommand("select reqId, MarryHelps.description, MarryHelpReq.description, introdescription, resdescription, fee from MarryHelps, MarryHelpReq where MarryHelps.reqId = MarryHelpReq.id and MarryHelps.id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.id);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            this.rId            = reader.GetString(0);
                            explainTextBox.Text = reader.GetString(2) + " " + reader.GetString(1) + " " + reader.GetString(3) + " " + reader.GetString(4);
                            this.fee            = feeNumericUpDown.Value = reader.GetDecimal(5);
                        }
                    }
                }
                else
                {
                    visitPreAssignmentButton.Visible = true;
                    assignmentLabel.BackColor        = Color.YellowGreen;
                    label22.Location                 = new Point(label22.Location.X, label22.Location.Y - 12);
                    assignmentLabel.Location         = new Point(assignmentLabel.Location.X, assignmentLabel.Location.Y - 12);
                    assignmentAddFileButton.Location = new Point(assignmentAddFileButton.Location.X, assignmentAddFileButton.Location.Y - 12);
                    cmdget = new SqlCommand("select reqId, MarryHelps.description, MarryHelpReq.description, introdescription, resdescription, fee from MarryHelps, MarryHelpReq where MarryHelps.reqId = MarryHelpReq.id and MarryHelps.id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.id);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            this.rId            = reader.GetString(0);
                            explainTextBox.Text = reader.GetString(2) + " " + reader.GetString(1) + " " + reader.GetString(3) + " " + reader.GetString(4); this.explain = reader.GetString(4);
                            this.fee            = feeNumericUpDown.Value = reader.GetDecimal(5);
                        }
                    }
                }
            }
            con.Close();
        }
Ejemplo n.º 22
0
        private void healHelpCheckReqForm_Load(object sender, EventArgs e)
        {
            rIdTextBox.SelectionAlignment       = HorizontalAlignment.Center;
            mIdTextbox.SelectionAlignment       = HorizontalAlignment.Center;
            enactmentTextbox.SelectionAlignment = HorizontalAlignment.Center;
            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            if (this.Text == "بررسی درخواست کمک درمان")
            {
                rIdTextBox.Text    = ExtensionFunction.EnglishToPersian(this.rId);
                denyButton.Enabled = setButton.Enabled = false;
                SqlCommand cmdget = new SqlCommand("select mId, description from HealHelpReq where id = @id;", con);
                cmdget.Parameters.AddWithValue("@id", this.rId);
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        this.mId            = reader.GetString(0); mIdTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
                        explainTextBox.Text = reader.GetString(1);
                    }
                }
            }
            else
            {
                this.BackColor     = Color.Yellow;
                denyButton.Visible = false;
                if (rad)
                {
                    SqlCommand cmdget = new SqlCommand("select mId, description, enactmentId from HealHelpReq where id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.rId);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            this.mId              = reader.GetString(0); mIdTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
                            explainTextBox.Text   = reader.GetString(1);
                            enactmentTextbox.Text = ExtensionFunction.EnglishToPersian(reader.GetString(2));
                        }
                    }
                    searchButton.Enabled     = false;
                    feeNumericUpDown.Enabled = false;
                    explainTextBox2.Enabled  = false;
                    setButton.Text           = "لغو ویرایش";
                    setButton.Enabled        = true;
                }
                else
                {
                    SqlCommand cmdget = new SqlCommand("select reqId, mId, HealHelps.description, HealHelps.enactmentId, fee, HealHelpReq.description from HealHelps, HealHelpReq where HealHelps.reqId = HealHelpReq.id and HealHelps.id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.id);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            this.rId              = reader.GetString(0); rIdTextBox.Text = ExtensionFunction.EnglishToPersian(this.rId);
                            this.mId              = reader.GetString(1); mIdTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
                            explainTextBox.Text   = reader.GetString(5) + " " + reader.GetString(2); this.explain = reader.GetString(2);
                            enactmentTextbox.Text = ExtensionFunction.EnglishToPersian(reader.GetString(3));
                            this.fee              = feeNumericUpDown.Value = reader.GetDecimal(4);
                        }
                    }
                }
                label17.Text      = "توضیحات کمک:"; label17.Location = new Point(searchButton.Location.X + 5, searchButton.Location.Y + 50);
                delButton.Visible = true;
            }
            calc_Consume();
            con.Close();
        }
        private void otherHelpIndivCheckReqForm_Load(object sender, EventArgs e)
        {
            cashtypeComboBox.DropDownStyle      = ComboBoxStyle.DropDownList;
            rIdTextBox.SelectionAlignment       = HorizontalAlignment.Center;
            mIdTextbox.SelectionAlignment       = HorizontalAlignment.Center;
            enactmentTextbox.SelectionAlignment = HorizontalAlignment.Center;
            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            rIdTextBox.Text = ExtensionFunction.EnglishToPersian(this.rId);
            if (this.Text == "بررسی درخواست کمک متفرقه فردی")
            {
                denyButton.Enabled = setButton.Enabled = false;
                SqlCommand cmdget = new SqlCommand("select mId, description from OtherHelpIndivReq where id = @id;", con);
                cmdget.Parameters.AddWithValue("@id", this.rId);
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        this.mId            = reader.GetString(0); mIdTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
                        explainTextBox.Text = reader.GetString(1);
                    }
                }
            }
            else
            {
                this.BackColor           = Color.Yellow;
                denyButton.Visible       = false;
                cashtypeComboBox.Enabled = false;
                if (rad)
                {
                    SqlCommand cmdget = new SqlCommand("select mId, description, enactmentId from OtherHelpIndivReq where id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.rId);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            this.mId              = reader.GetString(0); mIdTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
                            explainTextBox.Text   = reader.GetString(1);
                            enactmentTextbox.Text = ExtensionFunction.EnglishToPersian(reader.GetString(2));
                        }
                    }
                    searchButton.Enabled     = false;
                    feeNumericUpDown.Enabled = false;
                    explainTextBox2.Enabled  = false;
                    setButton.Text           = "لغو ویرایش";
                    setButton.Enabled        = true;
                }
                else
                {
                    SqlCommand cmdget = new SqlCommand("select reqId, mId, OtherHelpsIndiv.description, OtherHelpsIndiv.enactmentId, fee, OtherHelpIndivReq.description, cashtype from OtherHelpsIndiv, OtherHelpIndivReq where OtherHelpsIndiv.reqId = OtherHelpIndivReq.id and OtherHelpsIndiv.id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.id);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            this.rId              = reader.GetString(0); rIdTextBox.Text = ExtensionFunction.EnglishToPersian(this.rId);
                            this.mId              = reader.GetString(1); mIdTextbox.Text = ExtensionFunction.EnglishToPersian(this.mId);
                            explainTextBox.Text   = reader.GetString(5) + " " + reader.GetString(2); this.explain = reader.GetString(2);
                            enactmentTextbox.Text = ExtensionFunction.EnglishToPersian(reader.GetString(3));
                            this.fee              = feeNumericUpDown.Value = reader.GetDecimal(4);
                            if (reader.GetString(6) == "نقدی")
                            {
                                cashtypeComboBox.Text = "نقدی";
                            }
                            else
                            {
                                cashtypeComboBox.Text = "غیرنقدی";
                            }
                        }
                    }
                }
                label17.Text      = "توضیحات کمک:"; label17.Location = new Point(searchButton.Location.X + 5, searchButton.Location.Y + 50);
                delButton.Visible = true;
            }
            con.Close();
        }
Ejemplo n.º 24
0
        private void delButton_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            if (rad)
            {
                SqlCommand cmd = new SqlCommand("update MarryHelpReq Set status = @rstat, enactmentId = Null where id = @rId;", con);
                cmd.Parameters.AddWithValue("@rId", this.rId);
                cmd.Parameters.AddWithValue("@rstat", "ثبت شده");
                cmd.ExecuteNonQuery();
                FMessegeBox.FarsiMessegeBox.Show("درخواست با شماره " + this.rId + " مجددا آماده بررسی است!", "تبریک!", FMessegeBox.FMessegeBoxButtons.Ok, FMessegeBox.FMessegeBoxIcons.Information, FMessegeBox.FMessegeBoxDefaultButton.button1);
                con.Close();
                this.Close();
            }
            else
            {
                decimal    budget = 0, consume = 0, stock = 0;
                SqlCommand cmdget  = new SqlCommand("select amount from budgetsCurrencies where typename = @id", con);
                SqlCommand cmdget2 = new SqlCommand("select amount from budgetsCurrencies where typename = @id", con);
                SqlCommand cmdget3 = new SqlCommand("select amount from budgetsCurrencies where typename = @id", con);
                cmdget.Parameters.AddWithValue("@id", "marryBudget");
                cmdget2.Parameters.AddWithValue("@id", "marryConsume");
                cmdget3.Parameters.AddWithValue("@id", "marry");
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        budget = reader.GetDecimal(0);
                    }
                }
                using (SqlDataReader reader = cmdget2.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        consume = reader.GetDecimal(0);
                    }
                }
                using (SqlDataReader reader = cmdget3.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        stock = reader.GetDecimal(0);
                    }
                }
                System.IO.Directory.Delete(this.helpPath + "\\" + this.id, true);
                SqlCommand cmd;
                if (typeComboBox.Text == "غیرنقدی")
                {
                    cmd = new SqlCommand("BEGIN TRY begin tran t1; delete from MarryHelps where id = @id; update MarryHelpReq Set status = @rstat, enactmentId = Null where id = @rId; update budgetsCurrencies Set amount = @amount2 where typename = @tname2; update budgetsCurrencies Set amount = @amount3 where typename = @tname3; commit tran t1; END TRY BEGIN CATCH ROLLBACK END CATCH", con);
                    cmd.Parameters.AddWithValue("@amount3", stock + this.fee);
                    cmd.Parameters.AddWithValue("@tname3", "marry");
                }
                else
                {
                    cmd = new SqlCommand("BEGIN TRY begin tran t1; delete from MarryHelps where id = @id; update MarryHelpReq Set status = @rstat, enactmentId = Null where id = @rId; update budgetsCurrencies Set amount = @amount2 where typename = @tname2; commit tran t1; END TRY BEGIN CATCH ROLLBACK END CATCH", con);
                }
                cmd.Parameters.AddWithValue("@id", this.id);
                cmd.Parameters.AddWithValue("@rId", this.rId);
                cmd.Parameters.AddWithValue("@rstat", "ثبت شده");
                cmd.Parameters.AddWithValue("@amount2", consume - this.fee);
                cmd.Parameters.AddWithValue("@tname2", "marryConsume");
                cmd.ExecuteNonQuery();
                FMessegeBox.FarsiMessegeBox.Show("کمک با شماره " + ExtensionFunction.EnglishToPersian(this.id) + " با موفقیت حذف شد و درخواست با شماره " + this.rId + " مجددا آماده بررسی است!", "تبریک!", FMessegeBox.FMessegeBoxButtons.Ok, FMessegeBox.FMessegeBoxIcons.Information, FMessegeBox.FMessegeBoxDefaultButton.button1);
                con.Close();
                this.Close();
            }
        }
        private void bankAccountTransferEditForm2_Load(object sender, EventArgs e)
        {
            enactmentTextbox.SelectionAlignment = HorizontalAlignment.Center;
            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            SqlCommand cmdgetaccounts = new SqlCommand("select id, name from bankAccount;", con);

            using (SqlDataReader reader = cmdgetaccounts.ExecuteReader())
            {
                while (reader.Read())
                {
                    li.Add(new KeyValuePair <string, string>(reader.GetString(0), reader.GetString(1)));
                    srcBankAccountNameComboBox.Items.Add(reader.GetString(1));
                    dstBankAccountNameComboBox.Items.Add(reader.GetString(1));
                }
            }
            SqlCommand cmdget = new SqlCommand("select srcid, dstid, fee, tax, transporterName, subdate, transferdate, description from moneyTransfer where id = @id;", con);

            cmdget.Parameters.AddWithValue("@id", this.id);
            using (SqlDataReader reader = cmdget.ExecuteReader())
            {
                if (reader.Read())
                {
                    preSrcid = reader.GetString(0);
                    srcBankAccountNumberTextBox.Text = ExtensionFunction.EnglishToPersian(preSrcid);
                    preDstid = reader.GetString(1);
                    dstBankAccountNumberTextBox.Text = ExtensionFunction.EnglishToPersian(preDstid);
                    feeNumericUpDown.Value           = preFee = reader.GetDecimal(2);
                    taxNumericUpDown.Value           = preTax = reader.GetDecimal(3);
                    transporterNameTextBox.Text      = reader.GetString(4);
                    transferDateTimePickerX.SelectedDateInDateTime = Convert.ToDateTime(String.Format("{0}", reader["transferdate"])).Date;
                    explainTextBox.Text = reader.GetString(7);
                }
            }
            for (int i = 0; i < li.Count; i++)
            {
                if (li[i].Key == preSrcid)
                {
                    srcBankAccountNameComboBox.SelectedIndex = i;
                }
                if (li[i].Key == preDstid)
                {
                    dstBankAccountNameComboBox.SelectedIndex = i;
                }
            }
            if (srcBankAccountNameComboBox.SelectedIndex == -1)
            {
                srcBankAccountNameComboBox.Text = "حساب حذف شده";
            }
            if (dstBankAccountNameComboBox.SelectedIndex == -1)
            {
                dstBankAccountNameComboBox.Text = "حساب حذف شده";
            }
            SqlCommand cmdgetfile = new SqlCommand("select docpath from doc where id = @id;", con);

            cmdgetfile.Parameters.AddWithValue("@id", this.id);
            using (SqlDataReader reader = cmdgetfile.ExecuteReader())
            {
                if (reader.Read())
                {
                    preFile = reader.GetString(0);
                }
            }
            con.Close();
            srcBankAccountNameComboBox.DropDownStyle       = ComboBoxStyle.DropDownList;
            dstBankAccountNameComboBox.DropDownStyle       = ComboBoxStyle.DropDownList;
            srcBankAccountNumberTextBox.SelectionAlignment = HorizontalAlignment.Center;
            dstBankAccountNumberTextBox.SelectionAlignment = HorizontalAlignment.Center;
            transporterNameTextBox.SelectionAlignment      = HorizontalAlignment.Center;
        }
Ejemplo n.º 26
0
        private void marryHelpCheckReqForm_Load(object sender, EventArgs e)
        {
            rIdTextBox.SelectionAlignment       = HorizontalAlignment.Center;
            mIdTextbox.SelectionAlignment       = HorizontalAlignment.Center;
            enactmentTextbox.SelectionAlignment = HorizontalAlignment.Center;
            typeComboBox.DropDownStyle          = ComboBoxStyle.DropDownList;
            SqlConnection con = new SqlConnection(this.connection);

            con.Open();
            if (this.Text == "بررسی درخواست کمک ازدواج")
            {
                rIdTextBox.Text            = ExtensionFunction.EnglishToPersian(this.rId);
                denyButton.Enabled         = setButton.Enabled = false;
                typeComboBox.SelectedIndex = 0;
                SqlCommand cmdget = new SqlCommand("select mId, description, status from MarryHelpReq where id = @id;", con);
                cmdget.Parameters.AddWithValue("@id", this.rId);
                string st = "";
                using (SqlDataReader reader = cmdget.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        mIdTextbox.Text     = ExtensionFunction.EnglishToPersian(reader.GetString(0));
                        explainTextBox.Text = reader.GetString(1);
                        st = reader.GetString(2);
                    }
                }
                if (st == "ثبت شده نقدی")
                {
                    typeComboBox.Enabled = false;
                }
            }
            else
            {
                this.BackColor       = Color.Yellow;
                denyButton.Visible   = false;
                typeComboBox.Enabled = false;
                if (rad)
                {
                    SqlCommand cmdget = new SqlCommand("select mId, description, enactmentId from MarryHelpReq where id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.rId);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            mIdTextbox.Text       = ExtensionFunction.EnglishToPersian(reader.GetString(0));
                            explainTextBox.Text   = reader.GetString(1);
                            enactmentTextbox.Text = ExtensionFunction.EnglishToPersian(reader.GetString(2));
                        }
                    }
                    searchButton.Enabled     = false;
                    feeNumericUpDown.Enabled = false;
                    explainTextBox2.Enabled  = false;
                    setButton.Text           = "لغو ویرایش";
                    setButton.Enabled        = true;
                }
                else
                {
                    SqlCommand cmdget = new SqlCommand("select type, reqId, mId, MarryHelps.description, MarryHelps.enactmentId, fee, MarryHelpReq.description from MarryHelps, MarryHelpReq where MarryHelps.reqId = MarryHelpReq.id and MarryHelps.id = @id;", con);
                    cmdget.Parameters.AddWithValue("@id", this.id);
                    using (SqlDataReader reader = cmdget.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            typeComboBox.Text     = reader.GetString(0);
                            this.rId              = reader.GetString(1); rIdTextBox.Text = ExtensionFunction.EnglishToPersian(this.rId);
                            mIdTextbox.Text       = ExtensionFunction.EnglishToPersian(reader.GetString(2));
                            explainTextBox.Text   = reader.GetString(6) + " " + reader.GetString(3); this.explain = reader.GetString(3);
                            enactmentTextbox.Text = ExtensionFunction.EnglishToPersian(reader.GetString(4));
                            this.fee              = feeNumericUpDown.Value = reader.GetDecimal(5);
                        }
                    }
                }
                label17.Text      = "توضیحات کمک:"; label17.Location = new Point(searchButton.Location.X + 5, searchButton.Location.Y + 50);
                delButton.Visible = true;
            }

            con.Close();
        }
Ejemplo n.º 27
0
 private void searchButton_Click(object sender, EventArgs e)
 {
     if (this.Text == "ویرایش کمک جمعی با مصوبه")
     {
         var newform = new searchForm("ویرایش کمک جمعی با مصوبه");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش کمک جمعی اتفاقی")
     {
         var newform = new searchForm("ویرایش کمک جمعی اتفاقی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ارائه کمک جمعی")
     {
         var newform = new searchForm("ارائه کمک جمعی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش فایل‌های ارائه کمک جمعی")
     {
         var newform = new searchForm("ویرایش فایل‌های ارائه کمک جمعی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "تایید کمک جمعی")
     {
         var newform = new searchForm("تایید کمک جمعی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش تایید کمک جمعی")
     {
         var newform = new searchForm("ویرایش تایید کمک جمعی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش کمک تحصیلی")
     {
         var newform = new searchForm("ویرایش کمک تحصیلی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ارائه کمک تحصیلی")
     {
         var newform = new searchForm("ارائه کمک تحصیلی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش فایل‌های ارائه کمک تحصیلی")
     {
         var newform = new searchForm("ویرایش فایل‌های ارائه کمک تحصیلی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "تایید کمک تحصیلی")
     {
         var newform = new searchForm("تایید کمک تحصیلی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش تایید کمک تحصیلی")
     {
         var newform = new searchForm("ویرایش تایید کمک تحصیلی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ثبت درخواست کمک ازدواج")
     {
         var newform = new searchForm("ثبت درخواست کمک ازدواج");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش درخواست کمک ازدواج")
     {
         var newform = new searchForm("ویرایش درخواست کمک ازدواج");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "بررسی درخواست کمک ازدواج")
     {
         var newform = new searchForm("بررسی درخواست کمک ازدواج");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش بررسی درخواست کمک ازدواج تاییدشده")
     {
         var newform = new searchForm("ویرایش بررسی درخواست کمک ازدواج");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش بررسی درخواست کمک ازدواج ردشده")
     {
         var newform = new searchForm("ویرایش بررسی درخواست کمک ازدواج ردشده");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ارسال معرفی‌نامه جهیزیه")
     {
         var newform = new searchForm("ارسال معرفی‌نامه جهیزیه");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش ارسال معرفی‌نامه جهیزیه")
     {
         var newform = new searchForm("ویرایش ارسال معرفی‌نامه جهیزیه");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "دریافت نتیجه معرفی‌نامه جهیزیه")
     {
         var newform = new searchForm("دریافت نتیجه معرفی‌نامه جهیزیه");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش نتیجه معرفی‌نامه جهیزیه")
     {
         var newform = new searchForm("ویرایش نتیجه معرفی‌نامه جهیزیه");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
         else if (newform.Text.StartsWith("chooser"))
         {
             rad            = true;
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(8));
         }
     }
     else if (this.Text == "ارائه کمک ازدواج")
     {
         var newform = new searchForm("ارائه کمک ازدواج");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش‌ ارائه کمک ازدواج")
     {
         var newform = new searchForm("ویرایش‌ ارائه کمک ازدواج");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "تایید کمک ازدواج")
     {
         var newform = new searchForm("تایید کمک ازدواج");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش تایید کمک ازدواج")
     {
         var newform = new searchForm("ویرایش تایید کمک ازدواج");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ثبت درخواست کمک درمان")
     {
         var newform = new searchForm("ثبت درخواست کمک درمان");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش درخواست کمک درمان")
     {
         var newform = new searchForm("ویرایش درخواست کمک درمان");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "بررسی درخواست کمک درمان")
     {
         var newform = new searchForm("بررسی درخواست کمک درمان");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش بررسی درخواست کمک درمان تاییدشده")
     {
         var newform = new searchForm("ویرایش بررسی درخواست کمک درمان");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش بررسی درخواست کمک درمان ردشده")
     {
         var newform = new searchForm("ویرایش بررسی درخواست کمک درمان ردشده");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ارائه کمک درمان")
     {
         var newform = new searchForm("ارائه کمک درمان");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش‌ ارائه کمک درمان")
     {
         var newform = new searchForm("ویرایش‌ ارائه کمک درمان");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "تایید کمک درمان")
     {
         var newform = new searchForm("تایید کمک درمان");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش تایید کمک درمان")
     {
         var newform = new searchForm("ویرایش تایید کمک درمان");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش کمک متفرقه گروهی")
     {
         var newform = new searchForm("ویرایش کمک متفرقه گروهی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ارائه کمک متفرقه گروهی")
     {
         var newform = new searchForm("ارائه کمک متفرقه گروهی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش فایل‌های ارائه کمک متفرقه گروهی")
     {
         var newform = new searchForm("ویرایش فایل‌های ارائه کمک متفرقه گروهی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "تایید کمک متفرقه گروهی")
     {
         var newform = new searchForm("تایید کمک متفرقه گروهی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش تایید کمک متفرقه گروهی")
     {
         var newform = new searchForm("ویرایش تایید کمک متفرقه گروهی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ثبت درخواست کمک متفرقه فردی")
     {
         var newform = new searchForm("ثبت درخواست کمک متفرقه فردی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش درخواست کمک متفرقه فردی")
     {
         var newform = new searchForm("ویرایش درخواست کمک متفرقه فردی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "بررسی درخواست کمک متفرقه فردی")
     {
         var newform = new searchForm("بررسی درخواست کمک متفرقه فردی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش بررسی درخواست کمک متفرقه فردی تاییدشده")
     {
         var newform = new searchForm("ویرایش بررسی درخواست کمک متفرقه فردی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش بررسی درخواست کمک متفرقه فردی ردشده")
     {
         var newform = new searchForm("ویرایش بررسی درخواست کمک متفرقه فردی ردشده");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ارائه کمک متفرقه فردی")
     {
         var newform = new searchForm("ارائه کمک متفرقه فردی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش‌ ارائه کمک متفرقه فردی")
     {
         var newform = new searchForm("ویرایش‌ ارائه کمک متفرقه فردی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "تایید کمک متفرقه فردی")
     {
         var newform = new searchForm("تایید کمک متفرقه فردی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
     else if (this.Text == "ویرایش تایید کمک متفرقه فردی")
     {
         var newform = new searchForm("ویرایش تایید کمک متفرقه فردی");
         newform.ShowDialog(this);
         if (newform.Text.StartsWith("choose"))
         {
             idTextbox.Text = ExtensionFunction.EnglishToPersian(newform.Text.Substring(6));
         }
     }
 }