public string AgreeProtest_Save(string AgreePercentProtestID, string AgreementPercentID,
                                        string ProtestComment, string ProtestDate, string UserResponseID
                                        )
        {
            try
            {
                ClAgreePercentProtest cl = new ClAgreePercentProtest();
                cl.AgreementPercentID    = Convert.ToInt32(AgreementPercentID);
                cl.AgreePercentProtestID = Convert.ToInt32(AgreePercentProtestID);
                cl.ProtestComment        = ProtestComment;
                cl.ProtestDate           = DateConvert.sh2m(ProtestDate).ToString();
                cl.UserResponseID        = Convert.ToInt32(UserResponseID);
                int y = 0;
                if (AgreePercentProtestID == null || AgreePercentProtestID == "" || AgreePercentProtestID == "0")
                {
                    y = AgreePercentProtestClass.insert(cl);
                }
                else
                {
                    y = AgreePercentProtestClass.Update(cl);
                }

                return(y.ToString());
            }
            catch
            {
                return("0");
            }
        }
        //public void UpItem(object sender, EventArgs e)
        //{
        //    String AgreementFineID = ((HtmlAnchor)sender).HRef.ToString();
        //    LblParamAgreementFineID.Text = AgreementFineID;
        //    ClAgreePercentProtest cl = new ClAgreePercentProtest();
        //    cl.AgreementFineID = Convert.ToInt32(AgreementFineID);
        //    Data = cl;
        //    LightBox.Value = "1";

        //}

        protected void BtnInsert_Click(Object sender, System.EventArgs e)
        {
            ClAgreePercentProtest cl = new ClAgreePercentProtest();

            cl = Data;

            int t = 0;

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

            if (t == 0)
            {
                LblMsg.ForeColor = System.Drawing.Color.Red;
                LblMsg.Text      = "خطا در ثبت";
            }
            else
            {
                LblMsg.ForeColor = System.Drawing.Color.Green;
                LblMsg.Text      = "ثبت  انجام شد.";
                BindGrid();
            }
            // LightBox.Value = "0";
            LblParamAgreePercentProtestID.Text = "0";
        }
        public void BindGrid()
        {
            ClAgreePercentProtest cl = new ClAgreePercentProtest();

            if (AgreementPercentID == 0)
            {
                cl.AgreementPercentID = null;
            }
            else
            {
                cl.AgreementPercentID = AgreementPercentID;
            }

            if (UserResponseID2 != 0)
            {
                cl.UserResponseID2 = UserResponseID2;
            }


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

            if (ViewState["AgreePercentProtestID "] == null)
            {
                ViewState["AgreePercentProtestID"] = "AgreePercentProtestID Desc";
            }

            dv.Sort = Securenamespace.SecureData.CheckSecurity(ViewState["AgreePercentProtestID"].ToString()).ToString();
            GridView1.DataSource = dv;
            GridView1.DataBind();
        }
Example #4
0
        private void BindProtest()
        {
            ClAgreePercentProtest cl = new ClAgreePercentProtest();

            cl.UserResponseID = Convert.ToInt32(Session["UserID"].ToString());
            // cl.PeymnaKArID=Convert.ToInt32(Session["UserID"].ToString());
            DataSet ds = AgreePercentProtestClass.GetListNav(cl);

            lblAllProtest.Text  = ds.Tables[0].Rows.Count.ToString();
            lblAllProtest2.Text = ds.Tables[0].Rows.Count.ToString();

            dl1.DataSource = ds;
            dl1.DataBind();
            ds.Dispose();
        }
Example #5
0
        //---------------------------------------------------------------------------------------------------------
        public static DataSet GetList(ClAgreePercentProtest c)
        {
            SqlCommand cmd = new SqlCommand("PRC_AgreePercentProtest_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("AgreePercentProtestID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.AgreePercentProtestID);
            cmd.Parameters.Add(new SqlParameter("AgreementPercentID", SqlDbType.Int)).Value    = Securenamespace.SecureData.CheckSecurity(c.AgreementPercentID);
            cmd.Parameters.Add(new SqlParameter("ProtestStatusID", SqlDbType.Int)).Value       = Securenamespace.SecureData.CheckSecurity(c.ProtestStatusID);
            cmd.Parameters.Add(new SqlParameter("ProtestDate", SqlDbType.NVarChar)).Value      = Securenamespace.SecureData.CheckSecurity(c.ProtestDate);
            cmd.Parameters.Add(new SqlParameter("UserResponseID", SqlDbType.Int)).Value        = Securenamespace.SecureData.CheckSecurity(c.UserResponseID);
            cmd.Parameters.Add(new SqlParameter("ProtestComment", SqlDbType.NVarChar)).Value   = Securenamespace.SecureData.CheckSecurity(c.ProtestComment);
            cmd.Parameters.Add(new SqlParameter("UserResponseID2", SqlDbType.NVarChar)).Value  = Securenamespace.SecureData.CheckSecurity(c.UserResponseID2);


            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();
            }
        }
Example #6
0
        public static int insert(ClAgreePercentProtest c)

        {
            SqlCommand cmd = new SqlCommand("PRC_AgreePercentProtest_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("AgreementPercentID", SqlDbType.Int)).Value  = Securenamespace.SecureData.CheckSecurity(c.AgreementPercentID);
            cmd.Parameters.Add(new SqlParameter("ProtestStatusID", SqlDbType.Int)).Value     = Securenamespace.SecureData.CheckSecurity(c.ProtestStatusID);
            cmd.Parameters.Add(new SqlParameter("ProtestDate", SqlDbType.NVarChar)).Value    = Securenamespace.SecureData.CheckSecurity(c.ProtestDate);
            cmd.Parameters.Add(new SqlParameter("UserResponseID", SqlDbType.Int)).Value      = Securenamespace.SecureData.CheckSecurity(c.UserResponseID);
            cmd.Parameters.Add(new SqlParameter("ProtestComment", SqlDbType.NVarChar)).Value = Securenamespace.SecureData.CheckSecurity(c.ProtestComment);


            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();
            }
        }