Example #1
0
        private void BindYear()
        {
            ClCatalog cl = new ClCatalog();

            cl.CatalogTypeID = Convert.ToInt32("10");

            DataSet ds = CatalogClass.GetList(cl);

            ddYear.DataSource     = ds;
            ddYear.DataTextField  = "CatalogName";
            ddYear.DataValueField = "CatalogValue";
            ddYear.DataBind();
            ds.Dispose();


            ClCatalog cl2 = new ClCatalog();

            cl2.CatalogTypeID = Convert.ToInt32("101");

            DataSet ds1 = CatalogClass.GetList(cl2);

            ddDefauleYear.DataSource     = ds1;
            ddDefauleYear.DataTextField  = "CatalogName";
            ddDefauleYear.DataValueField = "CatalogValue";

            ddDefauleYear.DataBind();

            ds1.Dispose();
        }
Example #2
0
        public static String Create(ClCatalog cl)
        {
            int       i = 0;
            ClCatalog c = new ClCatalog();

            c.CatalogName   = cl.CatalogName;
            c.CatalogTypeID = cl.CatalogTypeID;
            c.CID           = cl.CID;
            if (c.CID == null || c.CID == 0)
            {
                i = TaxiDAL.CatalogClass.insert(c);
            }
            else
            {
                i = TaxiDAL.CatalogClass.Update(c);
            }

            if (i == 0)
            {
                return("خطا");
            }
            else
            {
                return("ثبت انجام شد");
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ClCatalog cl2 = new ClCatalog();
                cl2.CatalogTypeID = Convert.ToInt32("101");

                DataSet ds1 = CatalogClass.GetList(cl2);
                ddDefauleYear.DataSource     = ds1;
                ddDefauleYear.DataTextField  = "CatalogName";
                ddDefauleYear.DataValueField = "CatalogValue";

                ddDefauleYear.DataBind();

                ds1.Dispose();


                ddDefauleYear.Text = "1396";
                BindGrid();
            }
            else
            {
                ddDefauleYear.Text = ddDefauleYear.SelectedValue;
            }
        }
Example #4
0
 public void BindDD() {
     ClCatalog cl=new ClCatalog();
     cl.parentID=Convert.ToInt32(lblOwnerType.Text);
     DDDiscountType.DataSource = CatalogClass.GetList(cl);
     DDDiscountType.DataTextField = "CatalogName";
     DDDiscountType.DataValueField = "caid";
     DDDiscountType.DataBind();
 }
Example #5
0
        private void BindYear()
        {
            ClCatalog cl = new ClCatalog();

            cl.CatalogTypeID = Convert.ToInt32("10");

            DataSet ds = CatalogClass.GetList(cl);

            rpYear.DataSource = ds;
            rpYear.DataBind();
            ds.Dispose();
        }
Example #6
0
        private void BindSelectedItem()
        {
            ClCatalog cl = new ClCatalog();

            cl.CatalogTypeID = Convert.ToInt32("7");
            cl.Select        = 1;
            DataSet ds = CatalogClass.GetList(cl);

            rpSelectAllow.DataSource = ds;
            rpSelectAllow.DataBind();
            ds.Dispose();
        }
Example #7
0
        public static string Default2(ClCatalog cl)
        {
            string caid = cl.CID.ToString();
            int    i    = TaxiDAL.CatalogClass.Default2(caid);

            if (i == 0)
            {
                return("حذف منطقی با موفقیت انجام شد");
            }
            else
            {
                return("حذف منطقی با خطا مواجه شد.");
            }
        }
Example #8
0
        private void BindYear()
        {
            ClCatalog cl = new ClCatalog();

            cl.CatalogTypeID = 101;
            cl.parentID      = 1;

            DataSet ds = CatalogClass.GetList(cl);

            if (ds.Tables[0].Rows.Count > 0)
            {
                ddDefauleYear.SelectedValue = ds.Tables[0].Rows[0]["CAID"].ToString();
            }
        }
Example #9
0
        public void BindSemat()
        {
            ClCatalog c = new ClCatalog();

            c.CatalogTypeID = 1;
            DataSet ds = TaxiDAL.CatalogClass.GetList(c);

            DDsemat.DataSource     = ds;
            DDsemat.DataTextField  = "CatalogName";
            DDsemat.DataValueField = "CatalogValue";
            DDsemat.DataBind();
            ddRegion.DataSource     = TaxiDAL.CatalogClass.GetListTypeID("2");
            ddRegion.DataTextField  = "CatalogName";
            ddRegion.DataValueField = "CaID";
            ddRegion.DataBind();
        }
Example #10
0
        public static DataSet GetListTypeID(string CatlogtypID)
        {
            ClCatalog c = new ClCatalog();

            c.CatalogTypeID = Convert.ToInt32(CatlogtypID);
            SqlCommand cmd = new SqlCommand("PRC_Catalog_GetList", cnn);

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


            cmd.Parameters.Add(new SqlParameter("PageIndex", SqlDbType.NVarChar)).Value = c.PageIndex;
            cmd.Parameters.Add(new SqlParameter("PageSize", SqlDbType.NVarChar)).Value  = c.PageSize;
            cmd.Parameters.Add(new SqlParameter("Order", SqlDbType.NVarChar)).Value     = c.OrderDirection;
            cmd.Parameters.Add(new SqlParameter("OrderBy", SqlDbType.NVarChar)).Value   = c.OrderBy;


            cmd.Parameters.Add(new SqlParameter("CaID", SqlDbType.NVarChar)).Value          = c.CID;
            cmd.Parameters.Add(new SqlParameter("CatalogName", SqlDbType.NVarChar)).Value   = c.CatalogName;
            cmd.Parameters.Add(new SqlParameter("CatalogValue", SqlDbType.NVarChar)).Value  = c.CatalogValue;
            cmd.Parameters.Add(new SqlParameter("parentID", SqlDbType.NVarChar)).Value      = c.parentID;
            cmd.Parameters.Add(new SqlParameter("OrderID", SqlDbType.NVarChar)).Value       = c.OrderID;
            cmd.Parameters.Add(new SqlParameter("CatalogTypeID", SqlDbType.NVarChar)).Value = c.CatalogTypeID;



            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 #11
0
        protected void btnSaveYear_Click(object sender, EventArgs e)
        {
            ClCatalog cl = new ClCatalog();

            cl.CID           = Convert.ToInt32(ddDefauleYear.SelectedValue);
            cl.parentID      = 1;
            cl.CatalogTypeID = 101;
            int i = CatalogClass.Update(cl);

            if (i > 0)
            {
                lblmsg.Text = "ثبت انجام شد";
            }
            else
            {
                lblmsg.Text = "خطا در درج";
            }
        }
Example #12
0
        public void UpItem(object sender, EventArgs e)
        {
            String caid     = ((HtmlAnchor)sender).HRef.ToString().Split('$')[0].ToString();
            String Isselect = ((HtmlAnchor)sender).HRef.ToString().Split('$')[1].ToString();

            ClCatalog cl = new ClCatalog();

            cl.CID      = Convert.ToInt32(caid);
            cl.ISSelect = (Isselect == "1" ? 0:1);
            int t = CatalogClass.Update(cl);

            if (t == 0)
            {
                TerraficPlanBLL.Utility.ShowMsg(Page, TerraficPlanBLL.ProPertyData.MsgType.warning, "خطا");
            }
            else
            {
                BindGrid();
            }
        }
Example #13
0
        //---------------------------------------------------------------------------------------------------------
        public static int Update(ClCatalog c)
        {
            SqlCommand cmd = new SqlCommand("PRC_Catalog_Update", 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("CaID", SqlDbType.NVarChar)).Value          = c.CID;
            cmd.Parameters.Add(new SqlParameter("CatalogName", SqlDbType.NVarChar)).Value   = c.CatalogName;
            cmd.Parameters.Add(new SqlParameter("CatalogValue", SqlDbType.NVarChar)).Value  = c.CatalogValue;
            cmd.Parameters.Add(new SqlParameter("parentID", SqlDbType.NVarChar)).Value      = c.parentID;
            cmd.Parameters.Add(new SqlParameter("OrderID", SqlDbType.NVarChar)).Value       = c.OrderID;
            cmd.Parameters.Add(new SqlParameter("CatalogTypeID", SqlDbType.NVarChar)).Value = c.CatalogTypeID;
            cmd.Parameters.Add(new SqlParameter("ISSelect", SqlDbType.NVarChar)).Value      = c.ISSelect;

            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();
            }
        }
Example #14
0
        public static string get(ClCatalog cl)
        {
            ClCatalog cc = new ClCatalog();

            cc.OrderDirection = cl.OrderDirection;
            cc.OrderBy        = cl.OrderBy;
            cc.PageIndex      = cl.PageIndex;
            cc.CID            = cl.CID;
            cc.PageSize       = 10;
            cc.CatalogTypeID  = cl.CatalogTypeID;
            DataSet   ds = TaxiDAL.CatalogClass.GetList2(cc);
            DataTable dt = new DataTable("Pager");

            dt.Columns.Add("PageIndex");
            dt.Columns.Add("PageSize");
            dt.Columns.Add("RecordCount");
            dt.Rows.Add();
            dt.Rows[0]["PageIndex"]   = cl.PageIndex; // c.PageIndex;
            dt.Rows[0]["PageSize"]    = 100;          // c.PageSize;
            dt.Rows[0]["RecordCount"] = ds.Tables[0].Rows[0]["ROW_COUNT"];
            ds.Tables.Add(dt);
            ds.Tables[0].TableName = "Tbl_Catalog";
            return(ds.GetXml());
        }
Example #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ClCatalog cl2 = new ClCatalog();
                cl2.CatalogTypeID = Convert.ToInt32("101");

                DataSet ds1 = CatalogClass.GetList(cl2);

                ddDefauleYear.DataSource     = ds1;
                ddDefauleYear.DataTextField  = "CatalogName";
                ddDefauleYear.DataValueField = "CatalogValue";

                ddDefauleYear.DataBind();

                ds1.Dispose();
                ddDefauleYear.Items.Add("همه موارد");
                ddDefauleYear.Items[2].Value = "0";

                if (Request.QueryString["yearID"] != null)
                {
                    ddDefauleYear.SelectedValue = Request.QueryString["yearID"].ToString();
                    ddDefauleYear.Text          = Request.QueryString["yearID"].ToString();;
                }



                ClPersonal cl = new ClPersonal();
                cl.PersonalID = Convert.ToInt32(Session["PersonalID"].ToString());

                DataSet ds = PersonalClass.GetList(cl);
                DataRow dr = ds.Tables[0].Rows[0];
                if (dr["Manage"].ToString() != "1")
                {
                    Response.Redirect("PersonalView.aspx?msg=شما دسترسی به این صفحه ندارید");
                    return;
                }

                txtFromDate.Text = DateConvert.m2sh(DateTime.Now.AddDays(-10).ToString());
                txtToDate.Text   = DateConvert.m2sh(DateTime.Now.ToString());
                BindddNazar();

                if (Request.QueryString["sid"] != null)
                {
                    ddRequestStatus.SelectedValue = Request.QueryString["sid"].ToString();
                }

                if (Request.QueryString["pid"] != null)
                {
                    SetNameAndFamil(Convert.ToInt32(Request.QueryString["pid"]));
                }

                if (Request.QueryString["companyID"] != null)
                {
                    ddcompany.SelectedValue = Request.QueryString["companyID"].ToString();
                }


                BindGrid();
                if (GridView1.Items.Count == 0)
                {
                    TerraficPlanBLL.Utility.ShowMsg(Page, ProPertyData.MsgType.warning, "درخواستی وجود ندارد");
                }
            }

            else
            {
                ddDefauleYear.Text = ddDefauleYear.SelectedValue;
            }
        }