protected void BtnInsert_Click1(object sender, EventArgs e)
        {
            ClExplanRequest cl = new ClExplanRequest();

            cl = Data;

            int t = 0;

            if (CSharp.PublicFunction.ModeInsert(ExplanRequestOpenID.ToString()))
            {
                t = ExplanRequestClass.insert(cl);
            }
            else
            {
                t = ExplanRequestClass.Update(cl);
            }

            if (t == 0)
            {
                CSharp.Utility.ShowMsg(Page, CSharp.ProPertyData.MsgType.General_Success, "خطا در ثبت");
            }
            else
            {
                BindGrid();
            }
        }
        public void UpItem(object sender, EventArgs e)
        {
            String ExplanRequestOpenID = ((HtmlAnchor)sender).HRef.ToString();

            LblParamExplanRequestOpenID.Text = ExplanRequestOpenID;
            ClExplanRequest cl = new ClExplanRequest();

            cl.ExplanRequestOpenID = Convert.ToInt32(ExplanRequestOpenID);
            Data              = cl;
            LightBox.Value    = "1";
            BtnInsert.Visible = true;
        }
Beispiel #3
0
        //---------------------------------------------------------------------------------------------------------
        public static DataSet GetList(ClExplanRequest c)
        {
            SqlCommand cmd = new SqlCommand("PRC_ExplanRequest_GetList", cnn);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("UserIDLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetUserID();
            cmd.Parameters.Add(new SqlParameter("IpLog", SqlDbType.NVarChar)).Value     = CSharp.PublicFunction.GetIPAddress();
            cmd.Parameters.Add(new SqlParameter("OSLog", SqlDbType.NVarChar)).Value     = CSharp.PublicFunction.GetOS();
            cmd.Parameters.Add(new SqlParameter("OSVerLog", SqlDbType.NVarChar)).Value  = CSharp.PublicFunction.GetBrowser() + CSharp.PublicFunction.GetBrowserVersion();
            cmd.Parameters.Add(new SqlParameter("URLLog", SqlDbType.NVarChar)).Value    = CSharp.PublicFunction.GetURL();

            cmd.Parameters.Add(new SqlParameter("ExplanRequestOpenID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.ExplanRequestOpenID);
            cmd.Parameters.Add(new SqlParameter("FromDate", SqlDbType.NVarChar)).Value       = Securenamespace.SecureData.CheckSecurity(c.FromDate);
            cmd.Parameters.Add(new SqlParameter("ToDate", SqlDbType.NVarChar)).Value         = Securenamespace.SecureData.CheckSecurity(c.ToDate);
            cmd.Parameters.Add(new SqlParameter("IsOK", SqlDbType.Int)).Value           = Securenamespace.SecureData.CheckSecurity(c.IsOK);
            cmd.Parameters.Add(new SqlParameter("ForUserID", SqlDbType.Int)).Value      = Securenamespace.SecureData.CheckSecurity(c.ForUserID);
            cmd.Parameters.Add(new SqlParameter("RegDate", SqlDbType.NVarChar)).Value   = Securenamespace.SecureData.CheckSecurity(c.RegDate);
            cmd.Parameters.Add(new SqlParameter("ByUserID", SqlDbType.Int)).Value       = Securenamespace.SecureData.CheckSecurity(c.ByUserID);
            cmd.Parameters.Add(new SqlParameter("SYSOKDate", SqlDbType.NVarChar)).Value = Securenamespace.SecureData.CheckSecurity(c.SYSOKDate);
            cmd.Parameters.Add(new SqlParameter("ForAgreementID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.ForAgreementID);


            SqlParameter prmResult = new SqlParameter("Result", SqlDbType.Int);

            prmResult.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(prmResult);
            DataSet        ds = new DataSet();
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            try
            {
                cnn.Open();
                da.Fill(ds);
                return(ds);
            }
            catch (Exception ex)
            {
                return(null);
            }
            finally
            {
                cnn.Close();
            }
        }
Beispiel #4
0
        public static int insert(ClExplanRequest c)
        {
            SqlCommand cmd = new SqlCommand("PRC_ExplanRequest_Insert", cnn);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("UserIDLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetUserID();
            cmd.Parameters.Add(new SqlParameter("IpLog", SqlDbType.NVarChar)).Value     = CSharp.PublicFunction.GetIPAddress();
            cmd.Parameters.Add(new SqlParameter("OSLog", SqlDbType.NVarChar)).Value     = CSharp.PublicFunction.GetOS();
            cmd.Parameters.Add(new SqlParameter("OSVerLog", SqlDbType.NVarChar)).Value  = CSharp.PublicFunction.GetBrowser() + CSharp.PublicFunction.GetBrowserVersion();
            cmd.Parameters.Add(new SqlParameter("URLLog", SqlDbType.NVarChar)).Value    = CSharp.PublicFunction.GetURL();


            cmd.Parameters.Add(new SqlParameter("ExplanID", SqlDbType.Int)).Value       = Securenamespace.SecureData.CheckSecurity(c.ExplanID);
            cmd.Parameters.Add(new SqlParameter("FromDate", SqlDbType.NVarChar)).Value  = Securenamespace.SecureData.CheckSecurity(c.FromDate);
            cmd.Parameters.Add(new SqlParameter("ToDate", SqlDbType.NVarChar)).Value    = Securenamespace.SecureData.CheckSecurity(c.ToDate);
            cmd.Parameters.Add(new SqlParameter("IsOK", SqlDbType.Int)).Value           = Securenamespace.SecureData.CheckSecurity(c.IsOK);
            cmd.Parameters.Add(new SqlParameter("ForUserID", SqlDbType.Int)).Value      = Securenamespace.SecureData.CheckSecurity(c.ForUserID);
            cmd.Parameters.Add(new SqlParameter("RegDate", SqlDbType.NVarChar)).Value   = Securenamespace.SecureData.CheckSecurity(c.RegDate);
            cmd.Parameters.Add(new SqlParameter("ByUserID", SqlDbType.Int)).Value       = Securenamespace.SecureData.CheckSecurity(c.ByUserID);
            cmd.Parameters.Add(new SqlParameter("SYSOKDate", SqlDbType.NVarChar)).Value = Securenamespace.SecureData.CheckSecurity(c.SYSOKDate);
            cmd.Parameters.Add(new SqlParameter("ForAgreementID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.ForAgreementID);


            SqlParameter prmResult = new SqlParameter("Result", SqlDbType.Int);

            prmResult.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(prmResult);
            try
            {
                cnn.Open();
                cmd.ExecuteNonQuery();
                return(Convert.ToInt32(prmResult.Value));
            }
            catch (Exception ex)
            {
                return(0);
            }
            finally
            {
                cnn.Close();
            }
        }
        public void BindGrid()
        {
            ClExplanRequest cl = new ClExplanRequest();

            cl.ForAgreementID = Convert.ToInt32(TXTForAgreementID.Text);
            //    cl.ForUserID = Convert.ToInt32(TXTForUserID.Text);
            //    cl.ByUserID = Convert.ToInt32(TXTByUserID.Text);


            DataSet  ds = ExplanRequestClass.GetList(cl);
            DataView dv = new DataView(ds.Tables[0]);

            if (ViewState["ExplanRequest"] == null)
            {
                ViewState["ExplanRequest"] = "explanrequestopenid Desc";
            }
            dv.Sort = ViewState["ExplanRequest"].ToString();
            GridView1.DataSource = dv;
            GridView1.DataBind();
        }