Example #1
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);
    }
Example #2
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);
    }