예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session[CDKey.LOGINUSER] == null)
        {
            Response.Redirect("Login.aspx");
        }
        Label9.Text = "<div data-identity='" + (Session[CDKey.LOGINUSER] as tMember).fIdentity + "' style='display:none'></div>";


        Label[]     label    = { Label5, Label6, Label7, Label8 };
        tServices[] services = new tServices[4];
        if (Session[CDKey.ServiceChoose] != null)
        {
            services = (tServices[])Session[CDKey.ServiceChoose];
        }
        p.processMaual(Label1);
        p.processServiceSubClassTitle(Label2);
        p.processPage(Label3);
        p.processCity(Label4);
        for (int i = 0; i < 4; i++)
        {
            if (services[i] != null)
            {
                label[i].Text = "<a style = 'margin-right:3px;' href='#' class='btn btn-danger' data-delclass='" + (i + 1) + "'>刪除</a>" + services[i].fName + " , NT$ " + services[i].fMinMoney + " ~ " + services[i].fMaxMoney;
            }
            else
            {
                label[i].Text = "無選擇";
            }
        }
    }
예제 #2
0
    protected void Button5_Click(object sender, EventArgs e)
    {
        tServices x = db.tServices.FirstOrDefault(t => t.fIdServices == Convert.ToInt32(Session[CDKey.deleteservices].ToString()));

        if (x != null)
        {
            x.fDelete = "True";
        }



        /*var deletePic = from sp in db.tServicesPic
         *              where sp.fIdServices == Convert.ToInt32(Session[CDKey.deleteservices].ToString())
         *              select sp;
         * var deleteser = (from s in db.tServices
         *               where s.fIdServices == Convert.ToInt32(Session[CDKey.deleteservices].ToString())
         *               select s).First();
         * foreach (tServicesPic od in deletePic)
         * {
         *  db.tServicesPic.DeleteOnSubmit(od);
         * }
         * db.tServices.DeleteOnSubmit(deleteser);*/
        db.SubmitChanges();
        Session.Remove(CDKey.deleteservices);
        Response.Redirect("memberCenter_Store.aspx?delete1=3");
    }
예제 #3
0
    protected void update_Click(object sender, EventArgs e)
    {
        tServices x = db.tServices.FirstOrDefault(t => t.fIdServices == Convert.ToInt32(DropDownList1.SelectedItem.Value));

        x.fName        = TextBox1.Text;
        x.fDescription = TextBox2.Text;
        x.fMaxMoney    = Convert.ToInt32(tbMax.Text);
        x.fContent     = Textarea.InnerText;
        x.fUploadTime  = DateTime.Now;
        db.SubmitChanges();
        lblMsg.Visible     = true;
        TextBox1.Text      = "";
        TextBox2.Text      = "";
        tbMax.Text         = "";
        Textarea.InnerText = "";
    }
예제 #4
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        // Textarea.Value.Replace("\r\n", "<br/>");
        // TextBox2.Text = TextBox2.Text.Replace("\r\n", "<br/>");
        var newServices = new tServices
        {
            fIdStores           = id,
            fUploadTime         = DateTime.Now,
            fIdSubServicesClass = Convert.ToInt32(Dw2.SelectedItem.Value),
            fName        = TextBox1.Text,
            fMaxMoney    = Convert.ToInt32(tbMax.Text),
            fDescription = TextBox2.Text,
            fContent     = Textarea.Value
        };

        db.tServices.InsertOnSubmit(newServices);
        db.SubmitChanges();

        var last = (from ser in db.tServices
                    where ser.fIdStores == id
                    orderby ser.fIdServices descending
                    select new {
            la = ser.fIdServices
        }).Take(1);

        foreach (var l in last)
        {
            lastser = l.la;
        }
        var newServicesPic = new tServicesPic
        {
            fIdPhoto    = 1,
            fIdServices = lastser
        };

        db.tServicesPic.InsertOnSubmit(newServicesPic);
        db.SubmitChanges();



        TextBox1.Text      = "";
        TextBox2.Text      = "";
        tbMax.Text         = "";
        Textarea.InnerText = "";
        lblMsg.Visible     = true;
    }
    public void ProcessChooseService(int serviceId, HttpContext context, int serviceclass)
    {
        tServices[] services = new tServices[4];
        if (context.Session[CDKey.ServiceChoose] != null)
        {
            services = (tServices[])context.Session[CDKey.ServiceChoose];
        }
        string strMsg = "";
        var    table  = from t in db.tServices
                        where t.fIdServices == serviceId
                        select t;

        foreach (tServices s in table)
        {
            strMsg += "<a style='margin-right:3px;' href='#' class='btn btn-danger' data-delclass='" + serviceclass + "'>刪除</a>" + s.fName + " , NT$ " + s.fMaxMoney;
            services[serviceclass - 1] = s;
        }
        context.Session[CDKey.ServiceChoose] = services;
        context.Response.Write(strMsg);
    }