protected void Page_Load(object sender, EventArgs e)
    {
        //string text1 = Dns.GetHostName();
        //Response.Write("Host Name: " + text1 + "\r\nIP Adress:" + Dns.GetHostByName(text1).AddressList[0].ToString());

        if ((Request.QueryString["code"] != null))
        {
            code_s = Request.QueryString["code"];
        }
        else
        {
            Response.Redirect("default.aspx");
        }

        try
        {
            tblFactSaleCollection list_fact_sale = new tblFactSaleCollection();
            list_fact_sale.ReadList(Cruder.Core.Criteria.NewCriteria(tblFactSale.Columns.fact_code, Cruder.Core.CriteriaOperators.Like, 1));

            for (int i = 0; i < list_fact_sale.Count; i++)
            {
                Literal span1 = new Literal();
                span1.Text = "<span class=\"common_font\">کد کالا: </span>";
                Place_fact.Controls.Add(span1);

                Label lbl_code = new Label();
                lbl_code.Text      = list_fact_sale[i].stuff_code.ToString();
                lbl_code.CssClass  = "common_font";
                lbl_code.ForeColor = Color.Orange;
                Place_fact.Controls.Add(lbl_code);

                Literal space1 = new Literal();
                space1.Text = "&nbsp;&nbsp;&nbsp;";
                Place_fact.Controls.Add(space1);

                Literal span2 = new Literal();
                span2.Text = "<span class=\"common_font\">نام کالا: </span>";
                Place_fact.Controls.Add(span2);

                Label lbl_name = new Label();
                lbl_name.CssClass  = "common_font";
                lbl_name.Text      = list_fact_sale[i].stuff_name.ToString();
                lbl_name.ForeColor = Color.Orange;
                Place_fact.Controls.Add(lbl_name);

                Literal space2 = new Literal();
                space2.Text = "&nbsp;&nbsp;&nbsp;";
                Place_fact.Controls.Add(space2);

                Literal span3 = new Literal();
                span3.Text = "<span class=\"common_font\">تعداد کالا: </span>";
                Place_fact.Controls.Add(span3);

                Label lbl_tedad = new Label();
                lbl_tedad.CssClass  = "common_font";
                lbl_tedad.Text      = list_fact_sale[i].stuff_nom.ToString();
                lbl_tedad.ForeColor = Color.Orange;
                Place_fact.Controls.Add(lbl_tedad);

                Literal space3 = new Literal();
                space3.Text = "&nbsp;&nbsp;&nbsp;";
                Place_fact.Controls.Add(space3);

                Literal br1 = new Literal();
                br1.Text = "<br />";
                Place_fact.Controls.Add(br1);
            }
        }
        catch (Exception)
        {
        }
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string text1 = Dns.GetHostName();

        tblFactSaleCollection list_fact = new tblFactSaleCollection();

        list_fact.ReadList(Cruder.Core.Criteria.NewCriteria(tblFactSale.Columns.saler, Cruder.Core.CriteriaOperators.Like, Dns.GetHostByName(text1).AddressList[0].ToString()));


        try
        {
            if (list_fact.Count > 0)
            {
                code_fact = list_fact[0].fact_code;
            }
            else
            {
                tblFactSaleCollection list_no_fact = tblFactSale.readall();
                if (list_no_fact.Count > 0)
                {
                    code_fact = list_no_fact[list_no_fact.Count - 1].fact_code.ToString();
                }
                code_fact = (Convert.ToInt32(code_fact) + 1).ToString();
            }
        }
        catch (Exception)
        {
            code_fact = "1";
        }

        //add stuff into basket place holder
        try
        {
            for (int i = 0; i < list_fact.Count; i++)
            {
                Literal lt1 = new Literal();
                lt1.Text = "<p class=\"common_font\">نام کالا: <span class=\"common_font\" style=\"color:Orange;\">" + list_fact[i].stuff_name + "</span></p>";
                Place_bascket.Controls.Add(lt1);

                Literal lt2 = new Literal();
                lt2.Text = "<p class=\"common_font\">تعداد: <span style=\"color:Orange;\">" + list_fact[i].stuff_nom + "</span></p><hr />";
                Place_bascket.Controls.Add(lt2);

                Literal div1 = new Literal();
                div1.Text = "<div style=\"text-align:center;\">";
                Place_bascket.Controls.Add(div1);

                Literal div2 = new Literal();
                div2.Text = "</div>";
                Place_bascket.Controls.Add(div2);
            }

            if (list_fact.Count < 1)
            {
                //Literal lbl_empty = new Literal();
                //lbl_empty.Text = "<p class=\"common_font\">لیست خالی است</p>";
                //Place_bascket.Controls.Add(lbl_empty);
                btn_goto.Visible = false;
            }
            else
            {
                lbl_emplty.Visible = false;
            }

            //first data
            tblPorfolioCollection list_menu = new tblPorfolioCollection();
            list_menu.ReadList(Cruder.Core.Criteria.NewCriteria(tblPorfolio.Columns.grp_stuff, Cruder.Core.CriteriaOperators.Equal, 1));

            Literal header = new Literal();
            header.Text = "<h2 class=\"common_font\">عسل های چند گیاه</h2>";
            Place_stuff.Controls.Add(header);

            for (int i = 0; i < list_menu.Count; i++)
            {
                Literal top = new Literal();
                top.Text = "<div style=\"width:270px;float:right;margin-right: 30px;\"><img class=\"box_shadows img_sales\" src=\"img/stuff/stuff1.jpg\"/><div style=\"line-height: 22px;\">";
                Place_stuff.Controls.Add(top);

                Literal span1 = new Literal();
                span1.Text = "<span class=\"common_font\">" + list_menu[i].title_prof + "</span><br />";
                Place_stuff.Controls.Add(span1);

                Literal span2 = new Literal();
                span2.Text = "<span class=\"common_font\" style=\"color: red;\"><span class=\"common_font\" style=\"color: black;\">کد کالا: </span> &nbsp; " + list_menu[i].code_stuff + " &nbsp; </span><br />";
                Place_stuff.Controls.Add(span2);

                Literal span3 = new Literal();
                span3.Text = "<span class=\"common_font\" style=\"color: orange;\"><span class=\"common_font\" style=\"color: black;\">قیمت: </span> &nbsp; " + list_menu[i].pic_addr + " &nbsp; </span>";
                Place_stuff.Controls.Add(span3);

                Literal div1 = new Literal();
                div1.Text = "<div style=\"margin-top: 25px;\">";
                Place_stuff.Controls.Add(div1);

                Literal end_div = new Literal();
                end_div.Text = "</div></div></div>";
                Place_stuff.Controls.Add(end_div);
            }
        }
        catch (Exception)
        {
        }
    }
Example #3
0
    protected void btn_refresh_Click(object sender, EventArgs e)
    {
        //Response.Redirect("order.aspx?c=" + txt_code.Text);
        tblOrderCollection list_order_ddl = new tblOrderCollection();

        list_order_ddl.ReadList(Cruder.Core.Criteria.NewCriteria(tblOrder.Columns.act, Cruder.Core.CriteriaOperators.Equal, 0));

        if (list_order_ddl.Count <= 0)
        {
            btn_Save.Enabled = false;
        }
        else
        {
            place_fact.Controls.Clear();
            for (int j = 0; j < list_order_ddl.Count; j++)
            {
                Literal p1 = new Literal();
                p1.Text = "<p style=\"font-weight: initial;margin: 0;font-size: 9pt;\">فاکتور شماره " + list_order_ddl[j].fact_code + "</p>";
                place_fact.Controls.Add(p1);
            }

            tblOrderCollection list_order = new tblOrderCollection();
            list_order.ReadList(Cruder.Core.Criteria.NewCriteria(tblOrder.Columns.fact_code, Cruder.Core.CriteriaOperators.Equal, Convert.ToInt32(txt_code.Text)));

            if (list_order.Count > 0)
            {
                lbl_name.Text    = list_order[0].name_buy;
                lbl_name_co.Text = list_order[0].name_co;
                lbl_email.Text   = list_order[0].email;
                lbl_tel.Text     = list_order[0].tel;
                lbl_addr.Text    = list_order[0].addr;

                lbl_act.Text = "پاسخ داده نشده";
            }
            else
            {
                Place_detail.Controls.Clear();

                lbl_act.Text     = "";
                lbl_addr.Text    = "";
                lbl_email.Text   = "";
                lbl_name.Text    = "";
                lbl_name_co.Text = "";
                lbl_tel.Text     = "";
            }
            //detail  fact
            tblFactSaleCollection list = new tblFactSaleCollection();
            list.ReadList(Cruder.Core.Criteria.NewCriteria(tblFactSale.Columns.fact_code, Cruder.Core.CriteriaOperators.Like, txt_code.Text));

            for (int i = 0; i < list.Count; i++)
            {
                Literal span1 = new Literal();
                span1.Text = "<span class=\"common_font\">کد کالا: <span style=\"color:Orange;\">" + list[i].stuff_code + "</span></span>&nbsp;&nbsp;&nbsp;";
                Place_detail.Controls.Add(span1);

                Literal span2 = new Literal();
                span2.Text = "<span class=\"common_font\">نام کالا: <span style=\"color:Orange;\">" + list[i].stuff_name + "</span></span>&nbsp;&nbsp;&nbsp;";
                Place_detail.Controls.Add(span2);

                Literal span3 = new Literal();
                span3.Text = "<span class=\"common_font\">تعداد درخواستی: <span style=\"color:Orange;\">" + list[i].stuff_nom + "</span></span><br>";
                Place_detail.Controls.Add(span3);
            }

            btn_Save.Enabled = true;
        }
    }