Esempio n. 1
0
        protected void BtnSerach_Click1(object sender, EventArgs e)
        {
            DataSet  ds      = Sakhtikar.GetList(null, null, null, null, null);
            DataView dv      = new DataView(ds.Tables[0]);
            String   StrSort = Securenamespace.SecureData.CheckSecurity(ViewState["Sakhtikar"].ToString());

            if (StrSort != null)
            {
                dv.Sort = StrSort;
            }
            GridView1.DataSource = dv;
            GridView1.DataBind();
        }
Esempio n. 2
0
        public void DeleteItem(object sender, System.EventArgs e)
        {
            String id = ((HtmlAnchor)sender).HRef.ToString();
            int    i  = Sakhtikar.Delete(Convert.ToInt32(id));

            if (i == 0)
            {
                LblMsg.Text = " error ";
                ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('خطا در حذف');", true);
            }
            else
            {
                BindGrid();
            }
            LightBox.Value = "0";
        }
Esempio n. 3
0
        protected void BtnUpdate_Click(object sender, EventArgs e)
        {
            int i = Sakhtikar.Update(TXTid.Text, TXTKashtAvalieh.Text, TXTNahalBaghimandeh.Text, DDStreetTypeid.SelectedValue.ToString(), DDyear.SelectedValue.ToString());

            if (i == 0)
            {
                LblMsg.ForeColor = System.Drawing.Color.Red;
                LblMsg.Text      = "خطا";
            }
            else
            {
                LblMsg.ForeColor = System.Drawing.Color.Green;
                LblMsg.Text      = "ویرایش انجام شد";
                BindGrid();
            }
        }
Esempio n. 4
0
        protected void BtnInsert_Click1(Object sender, System.EventArgs e)
        {
            int t = Sakhtikar.insert(TXTKashtAvalieh.Text, TXTNahalBaghimandeh.Text, DDStreetTypeid.SelectedValue.ToString(), DDyear.SelectedValue.ToString());

            if (t == 0)
            {
                LblMsg.ForeColor = System.Drawing.Color.Red;
                LblMsg.Text      = "خطا در ثبت";
            }
            else
            {
                LblMsg.ForeColor = System.Drawing.Color.Green;
                LblMsg.Text      = "ثبت  انجام شد.";
                BindGrid();
            }
        }