//PO单身的插入按钮------往PO单身表中插入一条数据
        protected void InsertPO_Line_Click(object sender, EventArgs e)
        {
            List <String> line_num__list = new List <string>();
            string        Cancel_flag_insertPoLine = cancel_flag_insertPoLine.Value;
            int           item_id = 0, Request_qty_insertPoLine = 0;
            string        PO_no = PO_NO1.Value;

            //若单号已经处于暂收即不允许再进行修改
            if (poDC.getReceive_mtlByPo_no(PO_no))
            {
                PageUtil.showToast(this, PO_no + "单号已经开始暂收了,不可再修改!");
                return;
            }
            try
            {
                string item = Request.Form["Item"];//现在传进来的是item_name

                //判断,po单号下的单身中料号不可重复添加,应该直接修改已有单身!
                DataSet list = poDC.getPOLineByPo_noAndItem_name(PO_no, item);
                if (list != null)
                {
                    PageUtil.showToast(this, "单身中已有相同料号,请在原有单身上进行修改!");
                    return;
                }
                //将item_name转换成item_id
                PnDC pnDC = new PnDC();
                item_id = poDC.getItem_idByItem_name(item);

                //Item_id_insertPoLine = int.Parse(item);
                Request_qty_insertPoLine = int.Parse(request_qty_insertPoLine.Value);

                //调用PO单身的方法插入数据
                bool flag_poLineDC = poDC.insertPO_line(PO_no, item_id, Request_qty_insertPoLine, Cancel_flag_insertPoLine);
                if (flag_poLineDC)
                {
                    DataSet ds2 = new DataSet();
                    ds2 = poDC.getPOLineByPo_no(PO_no);
                    po_Line_Repeater.DataSource = ds2;
                    po_Line_Repeater.DataBind();

                    poSelect();
                    this.CleanPO_Line_Insert();
                    PageUtil.showToast(this, "插入成功!");
                    poSelect();
                }
                else
                {
                    PageUtil.showToast(this, "插入失败!请检查输入唯一性");
                    this.CleanPO_Line_Insert();
                }
            }
            catch
            {
                PageUtil.showToast(this, "请按格式输入!");
                this.CleanPO_Line_Insert();
            }
        }
Пример #2
0
        public void ProcessRequest(HttpContext context)
        {
            PnDC header_dc = new PnDC();

            List <string> list = new List <string>();

            list = header_dc.getAllItem_name();

            string json = toJson(list);

            context.Response.ContentType = "text/plain";

            context.Response.Write(json);
        }
        //更新按钮对应的操作
        protected void Update_Click_Pn(object sender, EventArgs e)
        {
            PnDC           pn = new PnDC();
            List <ModelPn> ModelPn_list;
            string         item_name     = ItemName_update_pn.Value.Trim();
            string         item_desc     = ItemDesc_update_pn.Value;
            string         uom           = Uom_update_pn.Value;
            DateTime       pn_updatetime = new DateTime();

            pn_updatetime = DateTime.Now;
            if (!StrLength_desc(item_desc))   //调用StrLength_desc()判断料号描述长度是否超出范围
            {
                return;
            }
            if (!StrLength_uom(uom))     //调用StrLength_uom()判断料号描述长度是否超出范围
            {
                return;
            }
            if (Session["LoginName"] == null)
            {
                PageUtil.showToast(this, "登录Id为空");
                return;
            }
            string id = Session["LoginName"].ToString();

            if (String.IsNullOrEmpty(item_name))
            {
                string temp = "料号不能为空!";
                PageUtil.showToast(this, temp);
            }

            Boolean flag;

            flag = pn.updatePn(item_name, item_desc, uom, pn_updatetime, id);  //调用DataCenter中PnDC.cs里面的updatePn()方法
            if (flag == true)
            {
                string temp = "数据更新成功!";
                PageUtil.showToast(this, temp);
                ModelPn_list           = pn.getPnBySome(item_name, item_desc, uom);
                Pn_Repeater.DataSource = ModelPn_list;
                Pn_Repeater.DataBind();
            }
            else
            {
                string temp = "数据更新失败!";
                PageUtil.showToast(this, temp);
            }
        }
Пример #4
0
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList2.Items.Clear();
            PnDC    dc  = new PnDC();
            DataSet ds2 = dc.getFrameNameBySubinventory(DropDownList1.Items[DropDownList1.SelectedIndex].Text);

            if (ds2 != null)
            {
                DropDownList2.DataSource     = ds2.Tables[0].DefaultView;
                DropDownList2.DataValueField = "frame_key";
                DropDownList2.DataTextField  = "frame_name";
                DropDownList2.DataBind();
            }
            else
            {
                PageUtil.showToast(this.Page, "料架载入出错!");
            }
            DropDownList2.Items.Insert(0, "--选择料架--");
        }
        //查询按钮对应的操作
        protected void Select_Click_Pn(object sender, EventArgs e)
        {
            PnDC           pn        = new PnDC();
            string         item_name = ItemName_pn.Value.Trim();
            string         item_desc = ItemDesc_pn.Value;
            string         uom       = UOM_pn.Value;
            List <ModelPn> ModelPn_list;

            ModelPn_list = pn.getPnBySome(item_name, item_desc, uom); //调用DataCenter中PnDC.cs里面的getPnBySome()方法
            if (ModelPn_list == null)
            {
                string temp = "数据库没有该数据,查询失败!";
                PageUtil.showToast(this, temp);
            }
            else
            {
                Pn_Repeater.DataSource = ModelPn_list;
                Pn_Repeater.DataBind();
                string temp = "查询成功!";
                PageUtil.showToast(this, temp);
            }
        }
Пример #6
0
        //更新按钮中的确定操作------更新Bom表中具体数据的部分字段
        protected void UpdateMeassage_Click(object sender, EventArgs e)
        {
            //string wo_no,string item_name,int operation_seq,int required_qty ,DateTime create_time)
            int    Requirement_line_id_Update = int.Parse(requirement_line_id_Update.Value);
            string big_item_name3             = item_name3.Value;
            String Item_name_Update           = small_item_name2.Value;
            string Operation_seq_num_Query    = Request.Form["operation_seq_num_Update"];
            string version      = version3.Value;
            string update_by    = "";
            string required_qty = required_qty_Update.Value;

            try
            {
                update_by = Session["LoginName"].ToString();
            }
            catch (Exception e2)
            {
                PageUtil.showToast(this.Page, "请登录之后再操作");
                return;
            }
            PnDC           pndc = new PnDC();
            List <ModelPn> mods = new List <ModelPn>();

            mods = pndc.getPnByITEM_NAME(big_item_name3);
            if (mods == null)
            {
                PageUtil.showToast(this.Page, "你输入的大料号不存在,请检查后输入");
                return;
            }
            mods = pndc.getPnByITEM_NAME(Item_name_Update);
            if (mods == null)
            {
                PageUtil.showToast(this.Page, "你输入的小料号不存在,请检查后输入");
                return;
            }
            if (string.IsNullOrWhiteSpace(version) == true)
            {
                PageUtil.showToast(this.Page, "版本号不能为空");
                return;
            }
            int      req_qty     = 0;
            DateTime UPDATE_TIME = new DateTime();

            UPDATE_TIME = DateTime.Now;
            Wip_operationDC wip_operationdc = new Wip_operationDC();

            try
            {
                req_qty = int.Parse(required_qty);
            }
            catch (Exception e1)
            {
                PageUtil.showToast(this.Page, "请输入正确的数量");
            }
            try
            {
                if (bomDC.getBomByThree(big_item_name3, Item_name_Update, version, req_qty) != null)
                {
                    string temp_ToastString = "该条数据在数据库中已存在,更新失败!";
                    PageUtil.showToast(this, temp_ToastString);
                    return;
                }
                bool flagBomDC = bomDC.updateBom(Requirement_line_id_Update, Item_name_Update, Operation_seq_num_Query, req_qty, version, update_by, UPDATE_TIME);

                if (flagBomDC)
                {
                    PageUtil.showToast(this, "更新成功!");
                    //modelBom_List = bomDC.getBomBySome(Wo_no_Update, Item_name_Update, Operation_seq_num_Update, Required_qty_Update);
                    bomRepeater.DataSource = bomDC.getBomBySome(big_item_name3, Item_name_Update, Operation_seq_num_Query, version);
                    bomRepeater.DataBind();
                }
                else
                {
                    PageUtil.showToast(this, "更新失败!请检查输入是否超出范围");
                }
            }
            catch (Exception ex)
            {
                string temp_ToastString = "请按格式输入,且不要超出范围";
                PageUtil.showToast(this, temp_ToastString);
            }
        }
Пример #7
0
        //插入按钮中的确定操作------往Bom表中插入一条数据
        protected void InsertMeassage_Click(object sender, EventArgs e)
        {
            String big_item_name2            = item_name2.Value;
            String Item_name_Insert          = small_item_name1.Value;
            string Operation_seq_num_Insert1 = Request.Form["operation_seq_num_Insert"];
            string version   = version2.Value;
            string req_qty   = required_qty_Insert.Value;
            string create_by = "";
            int    Required_qty_Insert;

            try
            {
                create_by = Session["LoginName"].ToString();
            }catch (Exception e3) {
                PageUtil.showToast(this.Page, "请登录之后再操作");
                return;
            }

            PnDC           pndc = new PnDC();
            List <ModelPn> mods = new List <ModelPn>();

            mods = pndc.getPnByITEM_NAME(big_item_name2);
            if (mods == null)
            {
                PageUtil.showToast(this.Page, "你输入的大料号不存在,请检查后输入");
                return;
            }
            mods = pndc.getPnByITEM_NAME(Item_name_Insert);
            if (mods == null)
            {
                PageUtil.showToast(this.Page, "你输入的小料号不存在,请检查后输入");
                return;
            }
            Wip_operationDC wip_operationdc = new Wip_operationDC();

            if (string.IsNullOrWhiteSpace(big_item_name2) == true)
            {
                //插入数据时工单编号不可未空,弹出警示框提示用户输入
                string temp_AlertString = "插入数据时大料号不可未空!请重新输入";
                PageUtil.showToast(this, temp_AlertString);
            }
            else if (string.IsNullOrWhiteSpace(version) == true)
            {
                PageUtil.showToast(this.Page, "版本号不能为空");
                return;
            }
            else
            {
                try   //判断输入字符是否符合规则
                {
                    if (string.IsNullOrWhiteSpace(required_qty_Insert.Value) == true)
                    {
                        PageUtil.showToast(this.Page, "请输入子料号数量");
                        return;
                    }
                    else
                    {
                        Required_qty_Insert = int.Parse(required_qty_Insert.Value);
                    }
                    if (bomDC.getBomByThree(big_item_name2, Item_name_Insert, version) != null)
                    {
                        string temp_ToastString = "该条数据在数据库中已存在,插入失败!";
                        PageUtil.showToast(this, temp_ToastString);
                        return;
                    }
                    //使用BomDC中的方法进行插入操作
                    bool flagBomDC = bomDC.insertBom(big_item_name2, Item_name_Insert, Operation_seq_num_Insert1, version, Required_qty_Insert, create_by, DateTime.Now);
                    if (flagBomDC == true)
                    {
                        string temp_ToastString = "该单号在数据库中存储成功!";
                        PageUtil.showToast(this, temp_ToastString);
                        //modelBom_List = bomDC.getBomBySome(Requirement_line_Insert, Item_name_Insert, Operation_seq_num_Insert, Required_qty_Insert);
                        bomRepeater.DataSource = bomDC.getBomBySome(big_item_name2, Item_name_Insert, Operation_seq_num_Insert1, version);
                        bomRepeater.DataBind();
                    }
                    else
                    {
                        string temp_ToastString = "该单号在数据库中存储失败!请检查输入是否超出范围";
                        PageUtil.showToast(this, temp_ToastString);
                    }
                }
                catch (Exception ex)
                {
                    string temp_ToastString = "请按格式输入,且不要超出范围";
                    PageUtil.showToast(this, temp_ToastString);
                }
            }
        }
Пример #8
0
        /// <summary>
        /// 编辑出货单单头信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Top_Edit(object sender, EventArgs e)
        {
            string strShip_key = edit_ship_key.Value;

            string strEdit_customer = edit_customer.Value;

            string strEdit_part_no = edit_part_no.Value;

            string strEdit_request_qty = Top_request_qty.Value;

            string strEdit_picked_qty = Top_picked_qty.Value;

            string ship_no = edit_ship_no.Value;

            int ship_key    = 0;
            int request_qty = 0;
            int picked_qty  = 0;
            int customer_id = 0;
            int part_no     = 0;

            try
            {
                ship_key = int.Parse(strShip_key);
                CustomersDC customerDc = new CustomersDC();
                customer_id = customerDc.getCustomeridByname(strEdit_customer);
                if (customer_id == -1)
                {
                    PageUtil.showToast(this, "该客户不存在,请检查数据!");
                    return;
                }
                request_qty = int.Parse(strEdit_request_qty);
                if (request_qty < 0)
                {
                    PageUtil.showToast(this, "数据格式错误,请输入数字!");
                    return;
                }
                picked_qty = int.Parse(strEdit_picked_qty);
                if (picked_qty < 0)
                {
                    PageUtil.showToast(this, "数据格式错误,请输入数字!");
                    return;
                }
                else if (picked_qty > 0)
                {
                    PageUtil.showToast(this, "该出货单已进行过出货操作,暂不支持修改!");
                    return;
                }
                PnDC pndc = new PnDC();
                part_no = pndc.getItem_idByItem_name(strEdit_part_no);
                if (part_no == -1)
                {
                    PageUtil.showToast(this, "该料号不存在!");
                    return;
                }
            }
            catch (Exception ex)
            {
                PageUtil.showToast(this, "数据异常!");
                return;
            }
            Transaction_operationDC trandc = new Transaction_operationDC();
            DataSet tds = trandc.getTransactionBySome("shipping", strEdit_part_no, ship_no);

            if (tds == null)
            {
                PageUtil.showToast(this, "数据异常!");
                return;
            }
            else if (tds.Tables[0].Rows.Count > 0)
            {
                PageUtil.showToast(this, "该出货单已进行过出货操作,暂不支持修改!");
                return;
            }
            try
            {
                DataSet ds = ship_dc.updateShip(ship_key, customer_id, part_no, request_qty, picked_qty);
                if (ds != null)
                {
                    updateTop_GridView(ds);
                    PageUtil.showToast(this, "修改成功!");
                }
                else
                {
                    PageUtil.showToast(this, "修改失败!");
                }
            }
            catch (Exception ex)
            {
                PageUtil.showToast(this, "修改失败!");
            }
        }
Пример #9
0
        /// <summary>
        /// 新增一条出货单单头信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Top_Insert(object sender, EventArgs e)
        {
            string strInput_customer = Request.Form["insert_customer_name_c"];

            strInput_customer = ship_dc.getCustomerIdByName(strInput_customer);

            string ship_no = top_insert_ship_no.Value.Trim();

            if (string.IsNullOrWhiteSpace(ship_no))
            {
                PageUtil.showToast(this, "出货单号不能为空!");
                return;
            }
            if (!ship_dc.queryShip_no(ship_no) && !ship_no.Equals(nextShip_no()))
            {
                PageUtil.showToast(this, "请输入正确的出货单号!");
                return;
            }

            string item_name = Request.Form["insert_item_name_c"];
            PnDC   pnDc      = new PnDC();
            int    item_id   = pnDc.getItem_idByItem_name(item_name);

            if (item_id == -1)
            {
                PageUtil.showToast(this, "该料号不存在,请输入正确的料号!");
                return;
            }
            int request_qty = 0;
            int picked_qty  = 0;

            try
            {
                request_qty = Int32.Parse(top_insert_request_qty.Value.Trim());
                if (request_qty < 0)
                {
                    PageUtil.showToast(this, "请输入正确的需求量!");
                    return;
                }
            }
            catch (Exception ex)
            {
                PageUtil.showToast(this, "请输入正确的需求量!");
                return;
            }
            try
            {
                picked_qty = Int32.Parse(top_insert_picked_qty.Value.Trim());
                if (picked_qty < 0)
                {
                    PageUtil.showToast(this, "请输入正确的需求量!");
                    return;
                }
            }
            catch (Exception ex)
            {
                PageUtil.showToast(this, "请输入正确的出货量!");
                return;
            }
            int customer_id = 0;

            try
            {
                customer_id = Int32.Parse(strInput_customer);
            }
            catch (Exception exception)
            {
                PageUtil.showToast(this, "客户信息异常!");
                return;
            }
            DataSet ds = ship_dc.insertAndReturnShip(ship_no, customer_id, item_id, request_qty, picked_qty);

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                top_insert_ship_no.Value     = "";
                top_insert_request_qty.Value = "";
                PageUtil.showToast(this, "添加成功!");
            }
            else
            {
                PageUtil.showToast(this, "添加出货单单头信息失败!");
            }

            updateTop_GridView(ds);
        }
Пример #10
0
        //提交按钮
        protected void Commite_reinspect(object sender, EventArgs e)
        {
            string item_name  = select_name_reinspect.Value.Trim();
            string datecode   = DateCode_reinspect.Value.Trim();
            string frame_name = Request.Form["frame_name_reinspect"]; //frame_name_reinspect.Value;
            string status     = reinspect_select.Value;
            string remark     = remark_reinspect.Value.Trim();

            //判断输入框输入数据是否超出范围
            StrItem_name(item_name);
            StrRemark(remark);
            StrDatecode(datecode);

            bool   flag;
            string temp_flag;
            string check_user = "";

            try
            {
                check_user = Session["LoginName"].ToString();
            }
            catch (Exception ex)
            {
                PageUtil.showToast(this, "请重新登录!");
                return;
            }

            Reinspect_parameterDC reinspectdc = new Reinspect_parameterDC();

            if (!reinspectdc.checkItem_name(item_name))
            {
                PageUtil.showToast(this, "该料号未设置复验周期,无法复验!");
                return;
            }


            DateTime check_time = new DateTime();

            check_time = DateTime.Now;
            int     item_id, frame_key;
            DataSet list;
            PnDC    pn = new PnDC();
            PoDC    DC = new PoDC();

            try
            {
                item_id   = DC.getItem_idByItem_name(item_name);
                frame_key = DC.getFrame_keyByFrame_name(frame_name);
            }
            catch
            {
                PageUtil.showToast(this, "输入格式错误!");
                return;
            }

            //判断库存明细表中是否存在该料号、库别和料架
            DataSet table = DC.getItems_onhand_qty_detailByITEM_NAMEandSubinventoryandFrame_key(item_name, datecode, frame_key);

            if (table != null && table.Tables[0].Rows.Count > 0)
            {
                temp_flag = reinspect.getLineNumByPoHeaderId(item_id, datecode, frame_key)[0].ToString();
                //如果复验状态是PASS,则需要复验
                if ((temp_flag.Equals("PENDING")))
                {
                    int unique_id = reinspect.getSome(item_name, datecode, frame_name, status);
                    //判断是否存在
                    if (unique_id == -1)
                    {
                        //不存在,新增一条数据
                        flag = reinspect.insertReinspectHeader(item_name, datecode, frame_name, status, remark, check_user, check_time);
                        PageUtil.showToast(this, "该料号未复验过,复验成功!");
                    }
                    else
                    {
                        //已存在,更新数据
                        flag = reinspect.updateReinspectHeader(unique_id, status, remark, check_user, check_time);
                        PageUtil.showToast(this, "该料号已复验过,更新成功!");
                    }
                    if (flag)
                    {
                        Material_ioDC iodc = new Material_ioDC();
                        if (iodc.updateStatus(item_name, datecode, frame_name, status, check_time))
                        {
                            pending(sender, e);
                            PageUtil.showToast(this, "库存信息更新成功!");
                        }
                        else
                        {
                            PageUtil.showToast(this, "库存信息更新失败!");
                        }
                    }
                    else
                    {
                        PageUtil.showToast(this, "操作失败!");
                    }
                }
                else
                {
                    PageUtil.showToast(this, "该料不需要复验!");
                }
            }
            else
            {
                PageUtil.showToast(this, "没有该条数据!");
                return;
            }
            CleanAllMeassage_Click(sender, e);
        }
        //插入操作对应的按钮
        protected void Insert_Click_pn(object sender, EventArgs e)
        {
            PnDC           pn = new PnDC();
            List <ModelPn> Modelpn_list;
            string         item_name     = ItemName_insert_pn.Value.Trim();
            string         item_desc     = ItemDesc_insert_pn.Value;
            string         uom           = Uom_insert_pn.Value;
            DateTime       pn_inserttime = new DateTime();

            pn_inserttime = DateTime.Now;
            if (!StrLength_name(item_name))   //调用StrLength_name()判断料号长度是否超出范围
            {
                return;
            }
            if (!StrLength_desc(item_desc))   //调用StrLength_desc()判断料号描述长度是否超出范围
            {
                return;
            }
            if (!StrLength_uom(uom))     //调用StrLength_uom()判断料号描述长度是否超出范围
            {
                return;
            }
            Boolean flag;

            if (Session["LoginName"] == null)
            {
                PageUtil.showToast(this, "登录Id为空");
                return;
            }
            string id = Session["LoginName"].ToString();

            if (String.IsNullOrEmpty(item_name))     //料号不能为空
            {
                string temp = "料号不能为空!";
                PageUtil.showToast(this, temp);
            }
            else
            {
                Modelpn_list = pn.getPnByITEM_NAME(item_name);     //查询后判断是否已存在该料号
                if (Modelpn_list == null)
                {
                    flag = pn.insertPn(item_name, item_desc, uom, pn_inserttime, id);//调用DataCenter中PnDC.cs里面的insertPn()方法
                    if (flag == true)
                    {
                        string temp = "数据插入成功!";
                        PageUtil.showToast(this, temp);
                        Modelpn_list           = pn.getPnBySome(item_name, item_desc, uom);
                        Pn_Repeater.DataSource = Modelpn_list;
                        Pn_Repeater.DataBind();
                    }
                    else
                    {
                        string temp = "数据插入失败!";
                        PageUtil.showToast(this, temp);
                    }
                }
                else
                {
                    string temp = "料号已存在,不能重复!";
                    PageUtil.showToast(this, temp);
                    return;
                }
            }
            ItemName_insert_pn.Value = String.Empty;  //清除插入部分的输入框内容
            ItemDesc_insert_pn.Value = String.Empty;
            Uom_insert_pn.Value      = String.Empty;
        }