예제 #1
0
    private bool DoAdd()
    {
        ps_depot model = new ps_depot();

        if (model.Exists(txttitle.Text.Trim()))
        {
            mym.JscriptMsg(this.Page, "您输入的商家名称已经存在,请检查!", "", "Error");
            return(false);
        }
        model.title           = txttitle.Text.Trim();
        model.code            = "";
        model.contact_name    = txtcontact_name.Text.Trim();
        model.contact_mobile  = txtcontact_tel.Text.Trim();
        model.contact_address = txtcontact_address.Text.Trim();
        model.category_id     = int.Parse(ddlCategoryId.SelectedValue.Trim());
        model.sort_id         = int.Parse(txtSortId.Text.Trim());
        model.remark          = txtremark.Text.Trim();
        if (cbIsLock.Checked == true)
        {
            model.status = 1;
        }
        else
        {
            model.status = 2;
        }
        if (model.Add() > 0)
        {
            mym.AddAdminLog("增加", "添加商家:" + txttitle.Text); //记录日志
            return(true);
        }

        return(false);
    }
예제 #2
0
    private bool DoAdd()
    {
        ps_manager model = new ps_manager();

        model.role_id = int.Parse(ddlRoleId.SelectedValue);
        if (ddlCategoryId.SelectedValue != "")
        {
            model.depot_category_id = int.Parse(ddlCategoryId.SelectedValue);
        }
        else
        {
            model.depot_category_id = 0;
        }

        if (ddlDepotId.SelectedValue != "")
        {
            model.depot_id = int.Parse(ddlDepotId.SelectedValue);
        }
        else
        {
            model.depot_id = 0;
        }

        //检测用户名是否重复
        if (model.Exists(txtUserName.Text.Trim()))
        {
            mym.JscriptMsg(this.Page, "用户名已经存在,请更换!", "", "Error");
            return(false);
        }
        model.user_name = txtUserName.Text.Trim();

        model.password  = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text.Trim(), "MD5");
        model.real_name = txtRealName.Text.Trim();
        model.add_time  = DateTime.Now;
        model.mobile    = txtmobile.Text.Trim();
        model.remark    = txtremark.Text.Trim();


        if (cbIsLock.Checked == true)
        {
            model.is_lock = 1;
        }
        else
        {
            model.is_lock = 2;
        }
        if (model.Add() > 0)
        {
            mym.AddAdminLog("增加", "添加用户:" + txtRealName.Text); //记录日志
            return(true);
        }

        return(false);
    }
예제 #3
0
    // 单个删除
    protected void lbtnDelCa_Click(object sender, EventArgs e)
    {
        // 当前点击的按钮
        LinkButton lb   = (LinkButton)sender;
        int        caId = int.Parse(lb.CommandArgument);
        ps_article bll  = new ps_article();

        bll.GetModel(caId);
        string title = bll.title;

        bll.Delete(caId);
        mym.AddAdminLog("删除", "删除公告:" + title + ""); //记录日志
        mym.JscriptMsg(this.Page, " 成功删除公告:" + title + "", Utils.CombUrlTxt("article_list.aspx", "keywords={0}&page={1}", this.keywords, this.page.ToString()), "Success");
    }
예제 #4
0
    private bool DoEdit(int _id)
    {
        DateTime now     = DateTime.Now;
        string   note_no = now.ToString("yy") + now.ToString("MM") + now.ToString("dd") + now.ToString("HH") + now.ToString("mm") + now.ToString("ss");

        bool          result = false;
        ps_here_depot model  = new ps_here_depot();

        model.GetModel(_id);
        model.product_num = int.Parse(Litproduct_num.Text) - int.Parse(txtproduct_num.Text);

        ps_join_depot model1 = new ps_join_depot();

        model1.product_category_id = model.product_category_id;
        model1.note_no             = note_no;
        model1.add_time            = DateTime.Now;
        model1.product_name        = model.product_name;
        model1.product_code_state  = "退货";
        model1.go_price            = model.go_price;
        model1.salse_price         = model.salse_price;
        model1.user_id             = Convert.ToInt32(Session["AID"]);
        model1.product_num         = int.Parse(txtproduct_num.Text);
        model1.here_depot_id       = _id;
        model1.dw = model.dw;
        model1.Add();

        if (model.UpdateALL())
        {
            mym.AddAdminLog("出库", "出库商品:" + txtproduct_name.Text); //记录日志
            result = true;
        }

        return(result);
    }
예제 #5
0
    // 单个删除
    protected void lbtnDelCa_Click(object sender, EventArgs e)
    {
        // 当前点击的按钮
        LinkButton lb   = (LinkButton)sender;
        int        caId = int.Parse(lb.CommandArgument);
        ps_manager bll  = new ps_manager();

        bll.GetModel(caId);
        string title = bll.user_name;

        ps_join_depot bllqd = new ps_join_depot();

        bllqd.user_id = caId;
        ps_salse_depot bllss = new ps_salse_depot();

        bllss.user_id = caId;
        if (!bllqd.ExistsYH() && !bllss.ExistsCZXS())
        {
            bll.Delete(caId);
            mym.AddAdminLog("删除", "删除用户名(账号):" + title + ""); //记录日志
            mym.JscriptMsg(this.Page, " 成功删除用户名(账号):" + title + "", Utils.CombUrlTxt("manager_list.aspx", "status={0}&category_id={1}&depot_id={2}&keywords={3}&page={4}", this.status.ToString(), this.category_id.ToString(), this.depot_id.ToString(), this.keywords, this.page.ToString()), "Success");
        }
        else
        {
            mym.JscriptMsg(this.Page, "系统中有该用户的相关操作记录,不能删除!可以通过修改禁用该用户!", "", "Error");
            return;
        }
    }
예제 #6
0
    //批量删除
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        int            sucCount   = 0; //成功数量
        int            errorCount = 0; //失败数量
        ps_manager_log bll        = new ps_manager_log();

        for (int i = 0; i < rptList.Items.Count; i++)
        {
            int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                if (bll.Delete(id))
                {
                    sucCount++;
                }
                else
                {
                    errorCount++;
                }
            }
        }
        mym.AddAdminLog("删除", "删除用户操作日志成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
        mym.JscriptMsg(this.Page, " 删除用户操作日志成功" + sucCount + "条,失败" + errorCount + "条", Utils.CombUrlTxt("manager_log.aspx", "keywords={0}&page={1}", this.keywords, this.page.ToString()), "Success");
    }
    private bool DoAdd()
    {
        ps_depot_category model = new ps_depot_category();

        if (model.Exists(txttitle.Text.Trim()))
        {
            mym.JscriptMsg(this.Page, "您输入的地区名称已经存在,请检查!", "", "Error");
            return(false);
        }

        model.title   = txttitle.Text.Trim();
        model.sort_id = int.Parse(txtSortId.Text.Trim());
        model.remark  = txtremark.Text.Trim();
        if (model.Add() > 0)
        {
            mym.AddAdminLog("增加", "添加地区:" + txttitle.Text); //记录日志
            return(true);
        }

        return(false);
    }
예제 #8
0
    private bool DoAdd()
    {
        ps_article model = new ps_article();

        model.title    = txttitle.Text.Trim();
        model.content  = txtContent.Value;
        model.add_time = Utils.StrToDateTime(txtAddTime.Text.Trim());
        model.sort_id  = int.Parse(txtSortId.Text.Trim());
        if (cbIsLock.Checked == true)
        {
            model.status = 1;
        }
        else
        {
            model.status = 2;
        }
        if (model.Add() > 0)
        {
            mym.AddAdminLog("增加", "添加通知公告:" + txttitle.Text); //记录日志
            return(true);
        }

        return(false);
    }
예제 #9
0
    private bool DoEdit(int _id)
    {
        bool          result = false;
        ps_here_depot model  = new ps_here_depot();

        model.GetModel(_id);

        model.product_url         = this.txtImgUrl.Text;
        model.product_category_id = int.Parse(ddlproduct_category_id.SelectedValue);
        model.product_name        = txtproduct_name.Text;
        model.go_price            = Convert.ToDecimal(this.txtgo_price.Text);
        model.salse_price         = Convert.ToDecimal(this.txtsalse_price.Text);
        if (model.UpdateALL())
        {
            mym.AddAdminLog("修改", "修改商品:" + txtproduct_name.Text); //记录日志
            result = true;
        }

        return(result);
    }
예제 #10
0
    private bool DoAdd()
    {
        DateTime now     = DateTime.Now;
        string   note_no = now.ToString("yy") + now.ToString("MM") + now.ToString("dd") + now.ToString("HH") + now.ToString("mm") + now.ToString("ss");

        ps_join_depot model = new ps_join_depot();

        model.product_category_id = int.Parse(ddlproduct_category_id.SelectedValue);
        model.note_no             = note_no;
        model.add_time            = DateTime.Now;
        model.product_name        = txtproduct_name.Text;
        model.product_code_state  = "入库";
        model.go_price            = Convert.ToDecimal(txtgo_price.Text);
        model.salse_price         = Convert.ToDecimal(txtsalse_price.Text);
        model.user_id             = Convert.ToInt32(Session["AID"]);
        model.product_num         = int.Parse(txtproduct_num.Text);
        model.dw = txtdw.Text;

        ps_here_depot model1 = new ps_here_depot();

        model1.product_url         = txtImgUrl.Text;
        model1.product_category_id = int.Parse(ddlproduct_category_id.SelectedValue);
        model1.add_time            = DateTime.Now;
        model1.product_name        = txtproduct_name.Text;
        model1.go_price            = Convert.ToDecimal(txtgo_price.Text);
        model1.salse_price         = Convert.ToDecimal(txtsalse_price.Text);
        model1.user_id             = Convert.ToInt32(Session["AID"]);
        model1.product_num         = int.Parse(txtproduct_num.Text);
        model1.dw     = txtdw.Text;
        model1.remark = txtremark.Text;
        model1.Add();
        model.here_depot_id = model1.GetMaxId(Convert.ToInt32(Session["AID"]));

        if (model.Add() > 0)
        {
            mym.AddAdminLog("入库", "商品入库,入库单号:" + note_no); //记录日志
            return(true);
        }

        return(false);
    }
예제 #11
0
    //保存
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        ps_manager model = new ps_manager();

        model.GetModel(Convert.ToInt32(Session["AID"]));

        string userPwd = FormsAuthentication.HashPasswordForStoringInConfigFile(txtOldPassword.Text.Trim(), "MD5");

        if (userPwd != model.password)
        {
            mym.JscriptMsg(this.Page, "旧密码不正确!", "", "Warning");
            return;
        }
        if (txtPassword.Text.Trim() != txtPassword1.Text.Trim())
        {
            mym.JscriptMsg(this.Page, "两次密码不一致!", "", "Warning");
            return;
        }
        model.password = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text.Trim(), "MD5");
        model.mobile   = txtmobile.Text.Trim();


        model.id = Convert.ToInt32(Session["AID"]);

        if (!model.UpdateMY())
        {
            ps_depot model1 = new ps_depot();
            model1.id = Convert.ToInt32(Litdepot_id.Text);
            model1.contact_address = txtcontact_address.Text.Trim();
            model1.UpdateAddress();

            mym.JscriptMsg(this.Page, "保存过程中发生错误!", "", "Error");
            return;
        }
        mym.AddAdminLog("修改", "修改个人信息:用户名:" + Lituser_name.Text); //记录日志
        mym.JscriptMsg(this.Page, "个人信息修改成功!请下次用新密码登陆!", "", "Success");
    }
예제 #12
0
    // 单个删除
    protected void lbtnDelCa_Click(object sender, EventArgs e)
    {
        // 当前点击的按钮
        LinkButton          lb   = (LinkButton)sender;
        int                 caId = int.Parse(lb.CommandArgument);
        ps_product_category bll  = new ps_product_category();

        bll.GetModel(caId);
        string        title = bll.title;
        ps_here_depot bllpp = new ps_here_depot();

        bllpp.product_category_id = caId;
        if (!bllpp.ExistsBM())//查找是否存在下级商品
        {
            bll.Delete(caId);
            mym.AddAdminLog("删除", "删除商品类别:" + title + ""); //记录日志
            mym.JscriptMsg(this.Page, " 成功删除商品类别:" + title + "", Utils.CombUrlTxt("product_category_list.aspx", "keywords={0}&page={1}", this.keywords, this.page.ToString()), "Success");
        }
        else
        {
            mym.JscriptMsg(this.Page, "有商品属于该商品类别,不能删除!", "", "Error");
            return;
        }
    }
예제 #13
0
    // 单个删除
    protected void lbtnDelCa_Click(object sender, EventArgs e)
    {
        // 当前点击的按钮
        LinkButton lb   = (LinkButton)sender;
        int        caId = int.Parse(lb.CommandArgument);
        ps_depot   bll  = new ps_depot();

        bll.GetModel(caId);
        string     title = bll.title;
        ps_manager bllpp = new ps_manager();

        bllpp.depot_id = caId;
        if (!bllpp.ExistsMD())//查找是否存在用户
        {
            bll.Delete(caId);
            mym.AddAdminLog("删除", "删除商家:" + title + ""); //记录日志
            mym.JscriptMsg(this.Page, " 成功删除商家:" + title + "", Utils.CombUrlTxt("depot_list.aspx", "status={0}&category_id={1}&keywords={2}&page={3}", this.status.ToString(), this.category_id.ToString(), this.keywords, this.page.ToString()), "Success");
        }
        else
        {
            mym.JscriptMsg(this.Page, "有用户属于该商家,不能删除!", "", "Error");
            return;
        }
    }