コード例 #1
0
ファイル: 获取单据.cs プロジェクト: KellySKL/VS_SQ
        /// <summary>
        /// 接收或是处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Bbt_Click(object sender, EventArgs e)
        {
            Label bt = sender as Label;

            if (Sx == "接收")
            {
                bt.Enabled = false;
                BILLnouse2 bi = new BILLnouse2();
                bi.FREENUM5 = 1;
                bi.Updata(" and id=" + id);
                //mc.Update接收维修信息(id);
                string getcode = IData.GetCode("m_rukuku", "NB");

                m_rukuku Mr = new m_rukuku
                {
                    CODE = getcode,
                    关联ID = id,
                    关联号  = (string)Ifun.IsDBnull(Dg.SelectedRows[0].Cells["code"].Value.ToString(), ""),
                    维修单  = Dg.SelectedRows[0].Cells["paytype"].Value.ToString(),
                    录单人  = UserInfo.UName,
                    录单时间 = SysTime.GetTime,
                    借用类型 = Ifun.IsDBnull(Dg.SelectedRows[0].Cells["freestr7"].Value.ToString(), "无借用").ToString(),
                    编号   = Dg.SelectedRows[0].Cells["materialCODE"].Value.ToString(),
                    物料   = Dg.SelectedRows[0].Cells["materialNAME"].Value.ToString(),
                    物料型号 = Dg.SelectedRows[0].Cells["specs"].Value.ToString(),
                    单位   = Dg.SelectedRows[0].Cells["UNITNAME"].Value.ToString(),
                    质保   = WXB,
                    数量   = decimal.Parse(Dg.SelectedRows[0].Cells["QUANTITY"].Value.ToString()),
                    仓库   = "维修库",
                    客户   = KF,
                    机床码  = JC,
                    维修人  = WXM
                };
                Mr.Insert();
                Dg.Rows.RemoveAt(Dg.SelectedRows[0].Index);
            }
            if (Sx == "评判")
            {
                decimal A = decimal.Parse(Dg.SelectedRows[0].Cells["数量"].Value.ToString());
                decimal B = Dg.SelectedRows[0].Cells["已处理"].Value.ToString() == "" ? 0 : decimal.Parse(Dg.SelectedRows[0].Cells["已处理"].Value.ToString());
                if (A - B > 0)
                {
                    num = A - B;
                    旧件处理 Js = new 旧件处理(id, num, KF);
                    if (Js.doBack)
                    {
                        Lb1_Click(null, null);
                    }
                }
                else
                {
                    Msg err = new Msg(3, "单据数量已处理完!");
                }
            }
        }
コード例 #2
0
        private void Btn_Click(object sender, EventArgs e)
        {
            Label btnn = sender as Label;

            if (btnn.Text == "取消")
            {
                doBack = false;
                Close();
            }
            if (Jhtime.Text == "")
            {
                Msg Er = new Msg(3, "请选择(要求完成时间)");
                return;
            }
            if (Tbinfo.Text == "")
            {
                Msg Er = new Msg(3, "请输入(处理依据)");
                return;
            }

            if (Wxman == "")
            {
                Msg Er = new Msg(3, "请选择(责任人)");
                return;
            }

            btnn.Text    = "正在保存数据中...";
            btnn.Enabled = false;

            //拆单逻辑
            for (int i = 1; i <= num; i++)
            {
                //保存逻辑
                m_rukukuinfo minfo = new m_rukukuinfo
                {
                    FID  = id,
                    物料   = Dt[0].物料,
                    物料型号 = Ifun.IsDBnull(Dt[0].物料型号, " ").ToString(),
                    编号   = Dt[0].编号,
                    单位   = Dt[0].单位,
                    借用类型 = Ifun.IsDBnull(Dt[0].借用类型, "无借用").ToString(),
                    维修类型 = typ,
                    预警时间 = DateTime.Parse(Jhtime.Text),
                    责任部门 = Ctyp,
                    责任人  = Wxman,
                    处罚部门 = CfBmn,
                    处罚人  = Cfmen,
                    判断时间 = SysTime.GetTime,
                    处理意见 = Tbinfo.Text.Trim(),
                    数量   = 1,
                    维修单  = Dt[0].维修单,
                    IS完成 = isWc,
                    要求时间 = Wxtime,
                };

                if (typ == "报废" || typ == "合格")
                {
                    minfo.终判类型 = typ;
                    minfo.过程信息 = Tbinfo.Text.Trim();
                }
                minfo.Insert();
            }


            doBack = true;
            //更新原数据条
            m_rukuku mr = new m_rukuku
            {
                已处理 = Dt[0].已处理 + num
            };

            mr.Updata("and id=" + id);
            Close();
        }
コード例 #3
0
ファイル: 获取单据.cs プロジェクト: KellySKL/VS_SQ
        private void Dg_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < -1)
            {
                return;
            }
            string Wxname = "维修单";

            Lis.Controls.Clear();
            this.SuspendLayout();
            id = int.Parse(Dg.SelectedRows[0].Cells["id"].Value.ToString());
            if (Wxinfo.Count < 0)
            {
                // mc.SetLabel(Lis, "无法读取数据!", true);
            }
            else
            {
                Label tmep = Skincss.AddLable(Lis, " ", "top", "0/40");
                if (Sx == "历史")
                {
                    Label Bmx = Skincss.AddLable(tmep, "查看分配明细", "10/0", (tmep.Width - 20) + "/30", "#255255255", 12, "", 1, -1, false, "#030164045");
                    Bmx.Click += Bmx_Click;
                }
                if (Sx == "接收")
                {
                    Wxname = "paytype";
                    Label Bbt = Skincss.AddLable(tmep, Sx, "10/0", (tmep.Width - 20) + "/30", "#255255255", 12, "", 1, -1, false, "#030164045");
                    Bbt.Click += Bbt_Click;
                }
                if (Sx == "评判")
                {
                    Label Bbt = Skincss.AddLable(tmep, "物料初步评判", "10/0", (tmep.Width - 20) + "/30", "#255255255", 12, "", 1, -1, false, "#030164045");
                    Bbt.Click += Bbt_Click;
                }
                if (Sx == "审核")
                {
                    Label pctmep = Skincss.AddLable(Lis, " ", "top", "0/40");
                    //  Label CNMX = Skincss.AddLable(pctmep, "提交总经办审批", "10/0", (tmep.Width - 20) + "/30", "#255255255", 12, "", 1, -1, false, "#030164045");
                    Label Bbt = Skincss.AddLable(tmep, "审核", "10/0", (tmep.Width - 20) + "/30", "#255255255", 12, "", 1, -1, false, "#030164045");
                    Bbt.Click += Bbt_Click6;
                    Printinfo();
                }
                if (Sx == "实施")
                {
                    //一步步读取 下一步

                    if (Dg.SelectedRows[0].Cells["接收人"].Value.ToString() == "")
                    {
                        Label Bbt = Skincss.AddLable(tmep, "接收维修单", "10/0", (tmep.Width - 20) + "/30", "#255255255", 12, "", 1, -1, false, "#030164045");
                        Bbt.Click += Bbt_Click1;
                    }
                    else if (DateTime.Parse(Dg.SelectedRows[0].Cells["开始维修时间"].Value.ToString()) == DateTime.MinValue)
                    {
                        Label Bbt = Skincss.AddLable(tmep, "开始维修", "10/0", (tmep.Width - 20) + "/30", "#255255255", 12, "", 1, -1, false, "#030164045");
                        Bbt.Click += Bbt_Click2;
                    }
                    else if (DateTime.Parse(Dg.SelectedRows[0].Cells["结束完成时间"].Value.ToString()) == DateTime.MinValue)
                    {
                        Label Bbt = Skincss.AddLable(tmep, "完成维修", "10/0", (tmep.Width - 20) + "/30", "#255255255", 12, "", 1, -1, false, "#030164045");
                        Bbt.Click += Bbt_Click3;
                    }
                    else
                    {
                        快递和反馈信息(tmep);
                    }
                }
                if (Sx == "客户")
                {
                    Printinfo();
                    Label Bbt = Skincss.AddLable(tmep, "物料判定", "10/0", (tmep.Width - 20) + "/30", "#255255255", 12, "", 1, -1, false, "#030164045");
                    Bbt.Click += Bbt_Click7;
                }

                //-----------------------
                //基础显示模块
                //-----------------------

                List <clientservice_AfterServiceBill> Tm = Wxinfo.Where(x => x.CODE == Dg.SelectedRows[0].Cells[Wxname].Value.ToString()).ToList();
                KF  = Tm[0].CLIENT.ToString();
                JC  = Tm[0].ZF1.ToString();
                WXM = Tm[0].BILLMAN.ToString();
                WXB = Tm[0].BILLTYPE.ToString();

                Label Pdinfo = Skincss.AddLable(Lis, "\n\r维修判断:\n\r" + Ifun.IsDBnull(Tm[0].ZF5, "无记录"), "top", "0/56", "#050050050", 10, "", 3);
                Pdinfo.Click += MsgShowIinfo_Click;
                tmep          = Skincss.AddLable(Lis, "维修员:" + WXM, "top", "0/35", "#050050050");
                tmep          = Skincss.AddLable(Lis, "机床码:" + JC, "top", "0/35", "#050050050");
                tmep          = Skincss.AddLable(Lis, "类型:" + WXB, "top", "0/35", "#050050050");
                tmep          = Skincss.AddLable(Lis, "客户:" + KF, "top", "0/35", "#050050050");

                tmep = Skincss.AddLable(Lis, "维修单信息", "top", "0/30", "#255255255", 12, "", 1, -1, false, Skin.upBColor);
                this.ResumeLayout(false);
            }
        }