基于web的进销存管理系统 第8页

基于web的进销存管理系统 第8页
权限设置流程图5-6
 图5-7 权限设置(JCXX_QX.aspx)
5.2.4进货单查询
在这个页面可以根据不同的条件查询查找存在的数据,并且可以根据表头进行排序,进货单查询流程图5-8,进货单查询图5-9所示。
进货单查询代码:
 public static IList<Jhd> getJhdsByCondition(string condition1,string condition2)
 { IList<Jhd> jhds = new List<Jhd>();
            try
            {
                string sql = "select jhrq,ywy,jhdbh,jhddbh,gysbh,ckbh,spbh,sl,dj,
zk,zje,sfjsfk,sfjz,yfje,jhdbz from jhd where 1=1";
                if (condition1 != "-1" && condition2 != null)
                    sql += " and " + condition1 + " like '%" + condition2 + "%'";
                using (SqlDataReader reader = DBHelper.GetReader(sql))
                {
                    while (reader.Read())
                    {
                        Jhd jhd = new Jhd();
                        jhds.Add(jhd);
                    }
                }
            }catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
            return jhds;
        }
}
进货查询流程图5-8
 图5-9 进货单查询(JH_JHCX.aspx)
5.2.5 销售订单校验
在这个页面可以对销售订单进行校验,随意更改一项、多项或全部状态(销售订单的四种状态的三种,分别是未确认、确认、退货、),销售单校验流程图5-10,销售单校验图5-11所示。
销售订单校验的部分代码:
    //绑定销售订单
    public void xsddDataBind() {
        gvXsddjy.DataSource = XsddManager.getAllXsdd("","3");
        gvXsddjy.DataBind();
    }
    //修改事件
    protected void btnxg_Click(object sender, EventArgs e)
    {
        if(ddlzt.SelectedValue == "-1"){
            lblmassage.Text = "请选择修改后的状态!";
        }
        else{
            string xsddbhs = string.Empty;
            for (int i = 0; i < gvXsddjy.Rows.Count;i++ )//遍历所有行
            {
                CheckBox ckb = (gvXsddjy.Rows[i].FindControl("ckbzt")) as CheckBox;
//获得id为ckbzt的控件并转化为CheckBox
                if(ckb.Checked == true){//如果选中
                    xsddbhs += (gvXsddjy.Rows[i].FindControl("lblxsddbh") as Label).Text + ",";//把选中项的编号累加到字符串中
                }
            }
            if (xsddbhs.Length > 0)
            {
                xsddbhs = xsddbhs.Substring(0, xsddbhs.Length - 1);//去掉末尾的逗号
                string zt = ddlzt.SelectedValue;//
                XsddManager.modifyZtByDdbh(zt, xsddbhs);//
                xsddDataBind();//
                lblmassage.Text = "成功修改选中项的状态!";
            }
            else {
                lblmassage.Text = "请选择要修改的项!";
            }
          
        }
    }
 销售单校验流程图5-10
 图5-11 销售订单校验(KC_XSDDJY.aspx)
5.2.6 库存信息设置
在这个页面可以对库存信息进行相关操作,库存信息设置流程图5-12,库存信息设置图5-13所示。
库存信息设置代码:
//后台代码
       protected void gvJhdd_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string jhddbh = Convert.ToString(e.CommandArgument);
        if(jhddbh!=null && jhddbh!=""){
            Jhdd jhdd = new Jhdd();
            jhdd = JhddManager.getJhddByJhddbh(jhddbh);
            if(jhdd!=null){
                Kc kc = new Kc();
                kc = KcManager.existsKcBySpbh(jhdd.Spbh);
                if(kc.Kcbh!=null){
                    txtbgxrqgx.Text = kc.Gxrq;
                    txtbkcbhgx.Text = Convert.ToString(kc.Kcbh);
                    Kcbh = Convert.ToString(kc.Kcbh);
                    if(kc.Ckbh!=null && kc.Ckbh!=""){
                        ddlckbhgx.SelectedItem.Selected = false;
                        ddlckbhgx.Items.FindByValue(kc.Ckbh).Selected = true;
                    }
                    if(kc.Spbh != 0){
                        ddlspbhgx.SelectedItem.Selected = false;
                        ddlspbhgx.Items.FindByValue(Convert.ToString(kc.Spbh)).Selected = true;
                    }
                    txtbslgx.Text = Convert.ToString(kc.Sl+jhdd.Sl);
                    txtbzjegx.Text = Convert.ToString(kc.Zje+jhdd.Zje);
                    ddlqhjggx.SelectedItem.Selected = false;
                  ddlqhjggx.Items.FindByValue(Convert.ToString(kc.Qhjg)).Selected = true;
                    txtbbzgx.Text = kc.Kcbz;
                    jhdd.Zt = 1;
                    JhddManager.modifyJhdd(jhdd);
                    jhddDataBind();

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有