Beispiel #1
0
 public DataSet PrintTaskList(string TaskId)
 {
     Sql2KDataAccess access = new Sql2KDataAccess();
     new Hashtable();
     DataSet ds = new DataSet();
     access.Run_SqlText(ref ds, "select * from V_Task Where TaskId='" + TaskId.Trim() + "'", "V_Task");
     access.Run_SqlText(ref ds, "select * from V_Np Where TaskId='" + TaskId.Trim() + "' Order By NpNo ", "V_Np");
     return ds;
 }
Beispiel #2
0
 public DataSet PrintSendList(string SendId)
 {
     Sql2KDataAccess access = new Sql2KDataAccess();
     new Hashtable();
     DataSet ds = new DataSet();
     access.Run_SqlText(ref ds, "select * from V_SendList Where SendId='" + SendId.Trim() + "'", "V_SendList");
     access.Run_SqlText(ref ds, "select * from V_List Where SendId='" + SendId.Trim() + "'", "V_List");
     access.Run_SqlText(ref ds, "select * from V_Np Where SendId='" + SendId.Trim() + "'", "V_Np");
     return ds;
 }
Beispiel #3
0
 public static List<PersonInfo> GetPersonInfoByTrueName(string TrueName)
 {
     List<PersonInfo> list2;
     try
     {
         Sql2KDataAccess access = new Sql2KDataAccess();
         List<PersonInfo> list = new List<PersonInfo>();
         DataSet set = access.Run_SqlText("select * from t_user where TrueName='" + TrueName + "'");
         if ((set != null) && (set.Tables[0].Rows.Count > 0))
         {
             for (int i = 0; i < set.Tables[0].Rows.Count; i++)
             {
                 PersonInfo item = new PersonInfo {
                     UserName = set.Tables[0].Rows[i]["UserName"].ToString(),
                     TrueName = set.Tables[0].Rows[i]["TrueName"].ToString(),
                     BarCode = set.Tables[0].Rows[i]["BarCode"].ToString()
                 };
                 list.Add(item);
             }
         }
         list2 = list;
     }
     catch (Exception exception)
     {
         throw exception;
     }
     return list2;
 }
Beispiel #4
0
 public static DataSet GetTodayWork(DateTime theDay)
 {
     string queryStr = "";
     DataSet set = new DataSet();
     Sql2KDataAccess access = new Sql2KDataAccess();
     queryStr = "select * from v_workplan where datediff(day,'" + theDay + "',WorkDay)=0";
     return access.Run_SqlText(queryStr);
 }
Beispiel #5
0
 public static void InsertFixedBox(DataSet FixedBoxSet)
 {
     if ((FixedBoxSet != null) && (FixedBoxSet.Tables[0].Rows.Count != 0))
     {
         string queryStr = "";
         Sql2KDataAccess access = new Sql2KDataAccess();
         for (int i = 0; i < FixedBoxSet.Tables[0].Rows.Count; i++)
         {
             queryStr = "Insert into t_WorkPlanFixedBox(WorkPLanID,TaskID)  values('" + FixedBoxSet.Tables[0].Rows[i]["WorkPlanID"].ToString() + "','" + FixedBoxSet.Tables[0].Rows[i]["TaskID"].ToString() + "')";
             access.Run_SqlText(queryStr);
         }
     }
 }
Beispiel #6
0
 public static void InsertWorkPlan(DataSet WorkPlanSet)
 {
     if ((WorkPlanSet != null) && (WorkPlanSet.Tables[0].Rows.Count != 0))
     {
         string queryStr = "";
         Sql2KDataAccess access = new Sql2KDataAccess();
         for (int i = 0; i < WorkPlanSet.Tables[0].Rows.Count; i++)
         {
             queryStr = string.Concat(new object[] { "Insert into t_WorkPlan(WorkPLanID,UserName,ProcessID,WorkLoad,WorkDay,MakeTime,MakePeron,Remark)  values('", WorkPlanSet.Tables[0].Rows[i]["WorkPLanID"].ToString(), "','", WorkPlanSet.Tables[0].Rows[i]["UserName"].ToString(), "','", WorkPlanSet.Tables[0].Rows[i]["ProcessID"].ToString(), "',", int.Parse(WorkPlanSet.Tables[0].Rows[i]["WorkLoad"].ToString()), ",'", WorkPlanSet.Tables[0].Rows[i]["WorkDay"].ToString(), "',getdate(),'", WorkPlanSet.Tables[0].Rows[i]["MakePeron"].ToString(), "','", WorkPlanSet.Tables[0].Rows[i]["Remark"].ToString(), "')" });
             access.Run_SqlText(queryStr);
         }
     }
 }
Beispiel #7
0
 public bool InsertToDBWarehouse(string TaskID, string OperateType, DateTime OperateTime, string HandlePerson, string OperationPerson)
 {
     string str;
     bool flag = false;
     if (((TaskID.Trim().Length < 1) || (OperateType.Trim().Length < 1)) || (OperationPerson.Trim().Length < 1))
     {
         return false;
     }
     if (TaskID.Substring(0, 1).CompareTo("T") == 0)
     {
         if (OperateType.CompareTo("入库") == 0)
         {
             str = "update T_Task set IsInWarehouse=1 where taskid='" + TaskID + "'";
         }
         else
         {
             str = "update T_Task set IsInWarehouse=0 where taskid='" + TaskID + "'";
         }
     }
     else if (OperateType.CompareTo("入库") == 0)
     {
         str = "update T_PanTaskInfo set IsInWarehouse=1 where Pantaskid='" + TaskID + "'";
     }
     else
     {
         str = "update T_PanTaskInfo set IsInWarehouse=0 where Pantaskid='" + TaskID + "'";
     }
     Sql2KDataAccess access = new Sql2KDataAccess();
     DataSet set = new DataSet();
     set = access.Run_SqlText(str);
     str = string.Concat(new object[] { "insert into T_WarehouseOperation(TaskID , OperateType , OperateTime ,HandlePerson , OperatePerson ) values('", TaskID, "','", OperateType, "','", OperateTime, "','", HandlePerson, "','", OperationPerson, "')" });
     if (access.Run_SqlText(str) != null)
     {
         flag = true;
     }
     access = null;
     return flag;
 }
Beispiel #8
0
 private void btn_ComQuery_Click(object sender, EventArgs e)
 {
     string str = null;
     if (this.cbx_PlanDepart.Text != "")
     {
         str = " Code='" + this.cbx_PlanDepart.SelectedValue.ToString().Trim() + "'";
     }
     if (this.cbx_PlanType.Text != "")
     {
         str = str + " And PlanType='" + this.cbx_PlanType.SelectedValue.ToString().Trim() + "'";
     }
     string text = this.cbx_TimeType.Text;
     if (text != null)
     {
         if (!(text == "计划下达时间"))
         {
             if (text == "录入时间")
             {
                 string str4 = str;
                 str = str4 + " And InPutTime between '" + this.dtp_From.Value.ToShortDateString() + "' and '" + this.dtp_To.Value.AddDays(1.0).ToShortDateString() + "'";
             }
             else if (text == "审核时间")
             {
                 string str5 = str;
                 str = str5 + " And AuditingTime between '" + this.dtp_From.Value.ToShortDateString() + "' and '" + this.dtp_To.Value.AddDays(1.0).ToShortDateString() + "'";
             }
             else if (text == "最后完成期限")
             {
                 string str6 = str;
                 str = str6 + " And DeadLine between '" + this.dtp_From.Value.ToShortDateString() + "' and '" + this.dtp_To.Value.AddDays(1.0).ToShortDateString() + "'";
             }
         }
         else
         {
             string str3 = str;
             str = str3 + " And PlanTime between '" + this.dtp_From.Value.ToShortDateString() + "' and '" + this.dtp_To.Value.AddDays(1.0).ToShortDateString() + "'";
         }
     }
     if (this.cbx_PlanState.Text == "审核通过")
     {
         str = str + " And IsPass='******'";
     }
     else if (this.cbx_PlanState.Text == "未审核通过")
     {
         str = str + " And IsPass='******'";
     }
     if (this.cbx_ChangeList.Text == "已转单")
     {
         str = str + " And PlanId1 is not null";
     }
     else if (this.cbx_ChangeList.Text == "未转单")
     {
         str = str + " And PlanId1 is null";
     }
     if (this.cbx_relation.Text.Trim() != "")
     {
         str = str + " And PlanNum" + this.cbx_relation.Text.Trim() + "TotalCount";
     }
     Sql2KDataAccess access = new Sql2KDataAccess();
     if (str.StartsWith(" And"))
     {
         int length = str.Length - 4;
         str = str.Substring(4, length);
     }
     DataSet set = access.Run_SqlText(this.PlanResult + " Where " + str + " order By PlanTime desc");
     this.dgv_Plan.DataSource = set.Tables[0];
     this.lab_Total.Text = "共查询到 " + set.Tables[0].Rows.Count.ToString() + " 条符合条件的记录";
 }
Beispiel #9
0
 private void btn_OutTime_Click(object sender, EventArgs e)
 {
     Sql2KDataAccess access = new Sql2KDataAccess();
     string str = "";
     if (this.cbx_IsReceive.Text == "已签收")
     {
         str = " and ReceivePerson is not null";
     }
     else if (this.cbx_IsReceive.Text == "未签收")
     {
         str = " and ReceivePerson is null";
     }
     DataSet set = access.Run_SqlText(this.SendResult + " Where SendTime between '" + this.dtp_From_Send.Value.ToShortDateString() + "' and '" + this.dtp_To_Send.Value.AddDays(1.0).ToShortDateString() + "' " + str + " order by sendTime desc");
     this.dgv_Send.DataSource = set.Tables[0];
     this.lab_Total_Send.Text = "共查询到 " + set.Tables[0].Rows.Count.ToString() + " 条符合条件的记录";
 }
Beispiel #10
0
 public static Hashtable GetPlanType()
 {
     Sql2KDataAccess access = new Sql2KDataAccess();
     DataSet set = new DataSet();
     Hashtable hashtable = new Hashtable();
     set = access.Run_SqlText("select Code,CodeName from V_PlanKind");
     if ((set != null) && (set.Tables[0].Rows.Count > 0))
     {
         for (int i = 0; i < set.Tables[0].Rows.Count; i++)
         {
             hashtable.Add(set.Tables[0].Rows[i]["Code"].ToString(), set.Tables[0].Rows[i]["CodeName"].ToString());
         }
     }
     return hashtable;
 }
Beispiel #11
0
 private void btn_AttendStat_Click(object sender, EventArgs e)
 {
     string str = "";
     this.splitContainer1.Panel2Collapsed = true;
     if (this.cbx_Person.Text.Trim() != "")
     {
         str = " and PersonId='" + this.cbx_Person.Text.Trim() + "'";
     }
     Sql2KDataAccess access = new Sql2KDataAccess();
     string queryStr = this.AttendanceQueryHead + " Where Arrivetime between '" + this.dtp_FromAttend.Value.ToShortDateString() + "' and '" + this.dtp_ToAttend.Value.AddDays(1.0).ToShortDateString() + "' " + str + "  order By PersonId,arrivetime desc";
     DataSet set = access.Run_SqlText(queryStr);
     this.dgv_State.DataSource = set.Tables[0];
     this.lab_StateInfo.Text = "共查询到 " + set.Tables[0].Rows.Count.ToString() + " 条符合条件的记录";
 }
Beispiel #12
0
 public void PrintSendDetail()
 {
     try
     {
         CpNpStat stat = new CpNpStat();
         Sql2KDataAccess access = new Sql2KDataAccess();
         DataSet ds = new DataSet();
         access.Run_SqlText(ref ds, "select Description ,TotalNum  from V_NpType t inner join (select Code,Count(NpId) as TotalNum from V_Np Where InPutTime between '" + this.m_FromDate.ToShortDateString() + "' and '" + this.ToDate.AddDays(1.0).ToShortDateString() + "'" + this.m_State + " Group By Code) t1 on t.Code=t1.Code", "V_NpStat");
         ParameterFields fields = new ParameterFields();
         ParameterField field = new ParameterField();
         ParameterDiscreteValue value2 = new ParameterDiscreteValue();
         field.ParameterFieldName="FromDate";
         value2.Value=this.m_FromDate.ToShortDateString();
         field.CurrentValues.Add(value2);
         fields.Add(field);
         field = new ParameterField();
         field.ParameterFieldName="ToDate";
         value2 = new ParameterDiscreteValue();
         value2.Value=this.m_ToDate.ToShortDateString();
         field.CurrentValues.Add(value2);
         fields.Add(field);
         field = new ParameterField();
         field.ParameterFieldName="State";
         value2 = new ParameterDiscreteValue();
         value2.Value=this.StateDesc;
         field.CurrentValues.Add(value2);
         fields.Add(field);
         this.crv_Send.ParameterFieldInfo=fields;
         ds.Tables[0].TableName = "V_NpState";
         stat.SetDataSource(ds);
         this.crv_Send.ReportSource=stat;
         this.crv_Send.PrintReport();
     }
     catch (Exception exception)
     {
         MessageBox.Show("打印时发生错误" + '\n' + exception.Message, "打印生产量统计", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Beispiel #13
0
 private void Pd_PrintPageSend(object sender, PrintPageEventArgs e)
 {
     new Font("隶书", 7.5f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
     string s = "机动车号牌送货单";
     string str2 = "瑞华交通工程有限公司";
     Font font = new Font("黑体", 20f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
     Font font2 = new Font("黑体", 12f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
     Font font3 = new Font("宋体", 12f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
     Font font4 = new Font("宋体", 12f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
     Font font5 = new Font("宋体", 10f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
     e.Graphics.DrawString(s, font, Brushes.Black, new PointF(300f, 60f));
     e.Graphics.DrawString(str2, font2, Brushes.Black, new PointF(330f, 100f));
     Sql2KDataAccess access = new Sql2KDataAccess();
     string queryStr = "select * from V_SendList Where SendId='" + this.LVICurPrint.Text.Trim() + "'";
     DataSet set = access.Run_SqlText(queryStr);
     if ((set != null) && (set.Tables[0].Rows.Count != 0))
     {
         e.Graphics.DrawString("计划单号 " + set.Tables[0].Rows[0]["planid"].ToString(), font5, Brushes.Black, new PointF(70f, 130f));
         e.Graphics.DrawString("计划单位 " + set.Tables[0].Rows[0]["plandepart"].ToString(), font5, Brushes.Black, new PointF(300f, 130f));
         e.Graphics.DrawString("送货单号 " + set.Tables[0].Rows[0]["sendid"].ToString(), font5, Brushes.Black, new PointF(550f, 130f));
         e.Graphics.DrawString("制表人 " + set.Tables[0].Rows[0]["truename"].ToString(), font5, Brushes.Black, new PointF(70f, 420f));
         e.Graphics.DrawString("制表时间 " + set.Tables[0].Rows[0]["sendtime"].ToString(), font5, Brushes.Black, new PointF(300f, 420f));
         e.Graphics.DrawString("送货人", font5, Brushes.Black, new PointF(70f, 450f));
         e.Graphics.DrawString("签收人", font5, Brushes.Black, new PointF(300f, 450f));
         e.Graphics.DrawString("签收单位", font5, Brushes.Black, new PointF(550f, 450f));
         Pen pen = new Pen(Brushes.Black) {
             Width = 1.2f
         };
         int num = 0x19;
         int num2 = 160;
         e.Graphics.DrawLine(pen, 70, num2, 770, num2);
         e.Graphics.DrawString("序号", font4, Brushes.Black, new PointF(150f, (float) (num2 + 3)));
         e.Graphics.DrawString("机动车号牌类型", font4, Brushes.Black, new PointF(300f, (float) (num2 + 3)));
         e.Graphics.DrawString("数量", font4, Brushes.Black, new PointF(550f, (float) (num2 + 3)));
         queryStr = "select * from V_List Where SendId='" + this.LVICurPrint.Text.Trim() + "'";
         DataSet set2 = access.Run_SqlText(queryStr);
         if ((set2 != null) && (set2.Tables[0].Rows.Count != 0))
         {
             int num3 = 0;
             for (int i = 0; i < set2.Tables[0].Rows.Count; i++)
             {
                 num2 = 190 + (i * num);
                 e.Graphics.DrawLine(pen, 70, num2, 770, num2);
                 e.Graphics.DrawString(Convert.ToString((int) (i + 1)), font3, Brushes.Black, new PointF(150f, (float) (num2 + 3)));
                 e.Graphics.DrawString(set2.Tables[0].Rows[i]["codename"].ToString(), font3, Brushes.Black, new PointF(300f, (float) (num2 + 3)));
                 e.Graphics.DrawString(set2.Tables[0].Rows[i]["totalnum"].ToString(), font3, Brushes.Black, new PointF(550f, (float) (num2 + 3)));
                 num3 += int.Parse(set2.Tables[0].Rows[i]["totalnum"].ToString());
             }
             num2 += num;
             e.Graphics.DrawLine(pen, 70, num2, 770, num2);
             e.Graphics.DrawString("总计", font4, Brushes.Black, new PointF(300f, (float) (num2 + 3)));
             e.Graphics.DrawString(num3.ToString(), font4, Brushes.Black, new PointF(550f, (float) (num2 + 3)));
             e.Graphics.DrawLine(pen, 70, num2 + num, 770, num2 + num);
             pen.Dispose();
         }
     }
 }
Beispiel #14
0
        private void listVwClickNP()
        {
            Sql2KDataAccess access = new Sql2KDataAccess();
            DataSet set = new DataSet();
            string[] strArray = new string[7];
            string str = "";
            strArray[0] = " PressTime is null and withdrawtime is not null" + str;
            strArray[1] = " presstime is not null and EraseTime is null and SmearTime is null and DryingTime is null and ClashTime is  null" + str;
            strArray[2] = " presstime is not null and EraseTime is not null and SmearTime is null and DryingTime is null and ClashTime is  null" + str;
            strArray[3] = " presstime is not null and EraseTime is null and SmearTime is not null and DryingTime is null and ClashTime is  null  " + str;
            strArray[4] = " presstime is not null  and DryingTime is not null and ClashTime is  null and ProcessPackTime is  null " + str;
            strArray[5] = " (ProcessPackTime is  null) and (presstime is not null and ((erasetime is not null and clashtime is not null) or (smeartime is not null)) and  dryingtime  is not null)" + str;
            strArray[6] = " (ProcessPackTime is  not null) and (presstime is not null )" + str;
            string str2 = "";
            if (this.treeVwAccount.SelectedNode.Name.Substring(0, 3).CompareTo("TCC") == 0)
            {
                switch (this.treeVwAccount.SelectedNode.Name.Length)
                {
                    case 6:
                        str2 = " and withdrawtime is not null";
                        break;

                    case 7:
                        str2 = " and withdrawtime is not null and Code ='" + this.treeVwAccount.SelectedNode.Name.Substring(6, 1) + "'";
                        break;

                    case 8:
                        str2 = " and Code ='" + this.treeVwAccount.SelectedNode.Parent.Name.Substring(6, 1) + "' and " + strArray[int.Parse(this.treeVwAccount.SelectedNode.Name.Substring(7, 1))];
                        break;
                }
                string queryStr = this.NpResult + "where (SendID IS NULL) AND description <> '4' and taskid is not null " + str2;
                set = access.Run_SqlText(queryStr);
                if (set != null)
                {
                    this.dataGridView1.DataSource = set.Tables[0].DefaultView;
                    this.dataGridView1.Refresh();
                    this.labelResultInfo.Text = "一共查询到" + set.Tables[0].Rows.Count.ToString() + "记录!";
                    queryStr = "Select count(*) as count FROM V_NPquery WHERE  (SendID IS NULL) AND description <> '4' and taskid is not null " + str2;
                    set = access.Run_SqlText(queryStr);
                    this.labelResultInfo.Text = this.labelResultInfo.Text + "车牌合计" + set.Tables[0].Rows[0]["count"].ToString();
                }
                else
                {
                    this.dataGridView1.DataSource = null;
                    this.dataGridView1.Rows.Clear();
                }
            }
        }
Beispiel #15
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     PrintDocument document = new PrintDocument();
     document.PrintPage += new PrintPageEventHandler(this.Pd_PrintPageSend);
     try
     {
         PrintPreviewDialog dialog = new PrintPreviewDialog {
             Document = document
         };
         PaperSize size = new PaperSize {
             Height = 0x21f,
             Width = 0x33b
         };
         Sql2KDataAccess access = new Sql2KDataAccess();
         DataSet set = access.Run_SqlText("select * from d_code where codetype=8 and code='SendListOff'");
         try
         {
             size.Height = int.Parse(set.Tables[0].Rows[0]["codename"].ToString());
         }
         catch
         {
             size.Height = 0x229;
             string queryStr = "insert into d_code(code,codetype,codename,description) values('SendListOff',8,'" + size.Height + "','打印纸高度')";
             access.Run_SqlText(queryStr);
         }
         document.DefaultPageSettings.PaperSize = size;
         document.PrinterSettings.PrinterName = Invoice.GetSendPrinter();
         dialog.WindowState = FormWindowState.Maximized;
         if (this.IsPreview)
         {
             dialog.ShowDialog();
         }
         else
         {
             document.Print();
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show("打印时发生错误" + '\n' + exception.Message, "打印送货单", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Beispiel #16
0
 private void Frm_Query_Load(object sender, EventArgs e)
 {
     base.Size = base.Parent.ClientSize;
     if (!User.IsHaveAuthority("车牌查询"))
     {
         this.tabControl.TabPages.Remove(this.tabPage1);
     }
     if (!User.IsHaveAuthority("计划单查询"))
     {
         this.tabControl.TabPages.Remove(this.tabPage2);
     }
     if (!User.IsHaveAuthority("生产任务单查询"))
     {
         this.tabControl.TabPages.Remove(this.tabPage3);
     }
     if (!User.IsHaveAuthority("送货单查询"))
     {
         this.tabControl.TabPages.Remove(this.tabPage4);
     }
     if (!User.IsHaveAuthority("底板查询"))
     {
         this.tabControl.TabPages.Remove(this.tabPage6);
     }
     if (!User.IsHaveAuthority("统计打印"))
     {
         this.tabControl.TabPages.Remove(this.tabPage5);
     }
     if (!User.IsHaveAuthority("库存统计"))
     {
         this.tabControl.TabPages.Remove(this.tabPage7);
     }
     if (!User.IsHaveAuthority("手工入库"))
     {
         this.btnInHouse.Enabled = false;
     }
     if (!User.IsHaveAuthority("补做审批"))
     {
         this.btnRemakeAppr.Enabled = false;
     }
     Sql2KDataAccess access = new Sql2KDataAccess();
     DataSet set = access.Run_SqlText("select * from V_Depart");
     DataRow row = set.Tables[0].NewRow();
     set.Tables[0].Rows.InsertAt(row, 0);
     this.cbx_PlanDepart.DataSource = set.Tables[0];
     this.cbx_PlanDepart.DisplayMember = "CodeName";
     this.cbx_PlanDepart.ValueMember = "Code";
     set = access.Run_SqlText("select * from V_PlanKind order by Code Desc");
     DataRow row2 = set.Tables[0].NewRow();
     set.Tables[0].Rows.InsertAt(row2, 0);
     this.cbx_PlanType.DataSource = set.Tables[0];
     this.cbx_PlanType.DisplayMember = "CodeName";
     this.cbx_PlanType.ValueMember = "Code";
     set = access.Run_SqlText("select UserName,TrueName from T_User ");
     DataRow row3 = set.Tables[0].NewRow();
     set.Tables[0].Rows.InsertAt(row3, 0);
     this.cbx_Workers.DataSource = set.Tables[0];
     this.cbx_Workers.DisplayMember = "TrueName";
     this.cbx_Workers.ValueMember = "UserName";
     set = access.Run_SqlText("select UserName,TrueName from T_User ");
     DataRow row4 = set.Tables[0].NewRow();
     set.Tables[0].Rows.InsertAt(row4, 0);
     this.cbx_Person.DataSource = set.Tables[0];
     this.cbx_Person.DisplayMember = "TrueName";
     this.cbx_Person.ValueMember = "UserName";
     this.cbx_TimeType.Items.Add("计划下达时间");
     this.cbx_TimeType.Items.Add("录入时间");
     this.cbx_TimeType.Items.Add("审核时间");
     this.cbx_TimeType.Items.Add("最后完成期限");
     this.cbx_TimeType.Text = this.cbx_TimeType.Items[0].ToString();
     this.cbx_PlanState.Items.Add("审核通过");
     this.cbx_PlanState.Items.Add("未审核通过");
     this.cbx_PlanState.Items.Insert(0, "");
     this.dtp_From.Value = DateTime.Now;
     this.dtp_To.Value = DateTime.Now;
     this.cbx_IsReceive.Items.Add("已签收");
     this.cbx_IsReceive.Items.Add("未签收");
     this.cbx_IsReceive.Items.Insert(0, "");
     this.cbx_ChangeList.Items.Add("已转单");
     this.cbx_ChangeList.Items.Add("未转单");
     this.cbx_ChangeList.Items.Insert(0, "");
     this.cbx_relation.Items.Add(">");
     this.cbx_relation.Items.Add("<");
     this.cbx_relation.Items.Add("=");
     this.cbx_relation.Items.Add("<>");
     this.cbx_relation.Items.Add(">=");
     this.cbx_relation.Items.Add("<=");
     this.cbx_relation.Items.Insert(0, "");
     this.cbx_NpState.Items.Add("未制作");
     this.cbx_NpState.Items.Add("制作中");
     this.cbx_NpState.Items.Add("制作完成");
     this.cbx_NpState.Items.Insert(0, "");
     this.cbx_SignIn.Visible = User.IsHaveAuthority("填写签收人");
     this.btn_RePrintSend.Visible = User.IsHaveAuthority("重新打印送货单");
     this.btn_RePrintTask.Visible = User.IsHaveAuthority("重新打印生产任务单");
 }
Beispiel #17
0
 private void AccountNP()
 {
     Sql2KDataAccess access = new Sql2KDataAccess();
     DataSet set = new DataSet();
     string[] strArray = new string[7];
     string[] strArray2 = new string[7];
     int num = 0;
     strArray[0] = "领料";
     strArray[1] = "压字";
     strArray[2] = "擦字";
     strArray[3] = "涂印";
     strArray[4] = "烘干";
     strArray[5] = "冲孔";
     strArray[6] = "装箱";
     string str2 = "SELECT description, COUNT(npid) AS COUNT FROM V_NPQuery  WHERE (SendID IS NULL) AND description <> '4' and taskid is not null ";
     string str3 = " GROUP BY description";
     strArray2[0] = " and PressTime is null and withdrawtime is not null" + str3;
     strArray2[1] = " and presstime is not null and EraseTime is null and SmearTime is null and DryingTime is null and ClashTime is  null" + str3;
     strArray2[2] = " and presstime is not null and EraseTime is not null and SmearTime is null and DryingTime is null and ClashTime is  null" + str3;
     strArray2[3] = " and presstime is not null and EraseTime is null and SmearTime is not null and DryingTime is null and ClashTime is  null  " + str3;
     strArray2[4] = " and presstime is not null  and DryingTime is not null and ClashTime is  null and ProcessPackTime is  null " + str3;
     strArray2[5] = " and (ProcessPackTime is  null) and ClashTime is not  null and (presstime is not null and ((erasetime is not null and clashtime is not null) or (smeartime is not null)) and  dryingtime  is not null)" + str3;
     strArray2[6] = " and (ProcessPackTime is  not null) and (presstime is not null )" + str3;
     string queryStr = "select * from V_NPType";
     set = access.Run_SqlText(queryStr);
     if (set != null)
     {
         if (this.treeVwAccount.Nodes.ContainsKey("TCCONP"))
         {
             this.treeVwAccount.Nodes.RemoveByKey("TCCONP");
         }
         TreeNode node = this.treeVwAccount.Nodes.Add("TCCONP", "车牌");
         for (int i = 0; i < set.Tables[0].Rows.Count; i++)
         {
             int num3 = 0;
             TreeNode node2 = node.Nodes.Add("TCCONP" + set.Tables[0].Rows[i]["code"].ToString(), set.Tables[0].Rows[i]["description"].ToString());
             queryStr = str2 + " and  description='" + set.Tables[0].Rows[i]["description"].ToString() + "' " + strArray2[0];
             DataSet set2 = access.Run_SqlText(queryStr);
             if ((set2 != null) && (set2.Tables[0].Rows.Count > 0))
             {
                 node2.Nodes.Add("TCCONPD0", strArray[0] + "(" + set2.Tables[0].Rows[0]["count"].ToString() + ")");
                 num3 += Convert.ToInt32(set2.Tables[0].Rows[0]["count"].ToString());
             }
             queryStr = str2 + " and  description='" + set.Tables[0].Rows[i]["description"].ToString() + "' " + strArray2[1];
             set2 = access.Run_SqlText(queryStr);
             if ((set2 != null) && (set2.Tables[0].Rows.Count > 0))
             {
                 node2.Nodes.Add("TCCONPD1", strArray[1] + "(" + set2.Tables[0].Rows[0]["count"].ToString() + ")");
                 num3 += Convert.ToInt32(set2.Tables[0].Rows[0]["count"].ToString());
             }
             queryStr = str2 + " and  description='" + set.Tables[0].Rows[i]["description"].ToString() + "' " + strArray2[2];
             set2 = access.Run_SqlText(queryStr);
             if ((set2 != null) && (set2.Tables[0].Rows.Count > 0))
             {
                 node2.Nodes.Add("TCCONPD2", strArray[2] + "(" + set2.Tables[0].Rows[0]["count"].ToString() + ")");
                 num3 += Convert.ToInt32(set2.Tables[0].Rows[0]["count"].ToString());
             }
             queryStr = str2 + " and  description='" + set.Tables[0].Rows[i]["description"].ToString() + "' " + strArray2[3];
             set2 = access.Run_SqlText(queryStr);
             if ((set2 != null) && (set2.Tables[0].Rows.Count > 0))
             {
                 node2.Nodes.Add("TCCONPD3", strArray[3] + "(" + set2.Tables[0].Rows[0]["count"].ToString() + ")");
                 num3 += Convert.ToInt32(set2.Tables[0].Rows[0]["count"].ToString());
             }
             queryStr = str2 + " and  description='" + set.Tables[0].Rows[i]["description"].ToString() + "' " + strArray2[4];
             set2 = access.Run_SqlText(queryStr);
             if ((set2 != null) && (set2.Tables[0].Rows.Count > 0))
             {
                 node2.Nodes.Add("TCCONPD4", strArray[4] + "(" + set2.Tables[0].Rows[0]["count"].ToString() + ")");
                 num3 += Convert.ToInt32(set2.Tables[0].Rows[0]["count"].ToString());
             }
             queryStr = str2 + " and  description='" + set.Tables[0].Rows[i]["description"].ToString() + "' " + strArray2[5];
             set2 = access.Run_SqlText(queryStr);
             if ((set2 != null) && (set2.Tables[0].Rows.Count > 0))
             {
                 node2.Nodes.Add("TCCONPD5", strArray[5] + "(" + set2.Tables[0].Rows[0]["count"].ToString() + ")");
                 num3 += Convert.ToInt32(set2.Tables[0].Rows[0]["count"].ToString());
             }
             queryStr = str2 + " and  description='" + set.Tables[0].Rows[i]["description"].ToString() + "'  " + strArray2[6];
             set2 = access.Run_SqlText(queryStr);
             if ((set2 != null) && (set2.Tables[0].Rows.Count > 0))
             {
                 node2.Nodes.Add("TCCONPD6", strArray[6] + "(" + set2.Tables[0].Rows[0]["count"].ToString() + ")");
                 num3 += Convert.ToInt32(set2.Tables[0].Rows[0]["count"].ToString());
             }
             node2.Text = node2.Text + "(" + num3.ToString() + ")";
             num += num3;
         }
         node.Text = node.Text + "(" + num.ToString() + ")";
     }
 }
Beispiel #18
0
 private void btn_Works_Click(object sender, EventArgs e)
 {
     string str = "";
     double num = 0.0;
     this.splitContainer1.Panel2Collapsed = true;
     if (this.cbx_Workers.Text.Trim() != "")
     {
         str = " and PersonId='" + this.cbx_Workers.SelectedValue.ToString().Trim() + "'";
     }
     Sql2KDataAccess access = new Sql2KDataAccess();
     string queryStr = "select truename as '工作人员', Wprocess as '工序',MaterialKind as '材料类型',Type as '类型/尺寸',WhichPiece as '前片/后片',sum(WorkLoad) as '工作量' from V_Works  Where begintime between '" + this.dtp_FromWorks.Value.ToShortDateString() + "' and '" + this.dtp_ToWorks.Value.AddDays(1.0).ToShortDateString() + "' " + str + " group By truename ,PersonId,Wprocess,MaterialKind,Type,WhichPiece order By PersonId";
     DataSet set = access.Run_SqlText(queryStr);
     this.dgv_State.DataSource = set.Tables[0];
     for (int i = 0; i < set.Tables[0].Rows.Count; i++)
     {
         try
         {
             num += double.Parse(set.Tables[0].Rows[i]["工作量"].ToString());
         }
         catch
         {
         }
     }
     this.lab_StateInfo.Text = "共查询到 " + set.Tables[0].Rows.Count.ToString() + " 条符合条件的记录 工作量总数:" + num.ToString();
 }
Beispiel #19
0
 private void btn_TaskId_Click(object sender, EventArgs e)
 {
     if (this.tbx_TaskId.Text.Trim() == "")
     {
         MessageBox.Show("请输入要查询的任务单号", "车牌查询", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         this.tbx_TaskId.Focus();
     }
     else
     {
         Sql2KDataAccess access = new Sql2KDataAccess();
         string queryStr = this.NpResult + " where TaskId='" + this.tbx_TaskId.Text.Trim() + "'";
         DataSet set = access.Run_SqlText(queryStr);
         this.drw_NpResult.DataSource = set.Tables[0];
         this.labTotal.Text = "共查询到 " + set.Tables[0].Rows.Count.ToString() + " 条符合条件的记录";
     }
 }
Beispiel #20
0
 private void btn_RePrintSend_Click(object sender, EventArgs e)
 {
     if ((this.dgv_Send.SelectedCells.Count > 0) && (this.dgv_Send.SelectedCells[0].ColumnIndex == 0))
     {
         Sql2KDataAccess access = new Sql2KDataAccess();
         string queryStr = "select * from V_SendList Where SendId='" + this.dgv_Send.SelectedCells[0].Value.ToString().Trim() + "'";
         this.SendListds = access.Run_SqlText(queryStr);
         if ((this.SendListds != null) && (this.SendListds.Tables[0].Rows.Count != 0))
         {
             queryStr = "select t_np.npno,v_nptype.codename,taskid from T_NP,v_nptype Where t_np.nptype=v_nptype.code and  SendId='" + this.dgv_Send.SelectedCells[0].Value.ToString().Trim() + "' order by taskid";
             this.SendListDetailsds = access.Run_SqlText(queryStr);
             if ((this.SendListDetailsds != null) && (this.SendListDetailsds.Tables[0].Rows.Count != 0))
             {
                 PrintDocument document = new PrintDocument();
                 PrintPreviewDialog dialog = new PrintPreviewDialog();
                 document.PrintPage += new PrintPageEventHandler(this.Pd_PrintPageSendDetails);
                 dialog.Document = document;
                 this.DetailPrintPage = 0;
                 try
                 {
                     dialog.WindowState = FormWindowState.Maximized;
                     document.PrinterSettings.PrinterName = Invoice.GetSendListPrinter();
                     if (this.cbx_PrintSendView.Checked)
                     {
                         dialog.ShowDialog();
                     }
                     else
                     {
                         document.Print();
                     }
                 }
                 catch (Exception exception)
                 {
                     MessageBox.Show("打印时发生错误" + '\n' + exception.Message, "打印送货单明细", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 }
                 FrmPrintSendList list = new FrmPrintSendList {
                     IsPreview = this.cbx_PrintSendView.Checked,
                     labelMakeperson = { Text = "制表人 " + this.SendListds.Tables[0].Rows[0]["truename"].ToString() },
                     labelMakeTime = { Text = "制表时间 " + this.SendListds.Tables[0].Rows[0]["sendtime"].ToString() },
                     textPlanID = { Text = this.SendListds.Tables[0].Rows[0]["planid"].ToString() },
                     combPlanDepart = { Text = this.SendListds.Tables[0].Rows[0]["plandepart"].ToString() },
                     textSendID = { Text = this.SendListds.Tables[0].Rows[0]["sendid"].ToString() },
                     textSendPerson = { Text = "" },
                     textRemark = { Text = "" }
                 };
                 queryStr = "select * from V_List Where SendId='" + this.dgv_Send.SelectedCells[0].Value.ToString().Trim() + "'";
                 DataSet set = access.Run_SqlText(queryStr);
                 if ((set != null) && (set.Tables[0].Rows.Count != 0))
                 {
                     int num = 0;
                     for (int i = 0; i < set.Tables[0].Rows.Count; i++)
                     {
                         list.GridVwSendInfo.Rows.Add();
                         list.GridVwSendInfo.Rows[list.GridVwSendInfo.NewRowIndex - 1].Cells[0].Value = Convert.ToString((int) (i + 1));
                         DataGridViewComboBoxCell cell = (DataGridViewComboBoxCell) list.GridVwSendInfo.Rows[list.GridVwSendInfo.NewRowIndex - 1].Cells[1];
                         cell.Value = set.Tables[0].Rows[i]["codename"].ToString();
                         list.GridVwSendInfo.Rows[list.GridVwSendInfo.NewRowIndex - 1].Cells[2].Value = set.Tables[0].Rows[i]["totalnum"].ToString();
                         num += int.Parse(set.Tables[0].Rows[i]["totalnum"].ToString());
                     }
                     list.labelTotal.Text = "总计" + num.ToString();
                     list.ShowDialog();
                 }
             }
         }
     }
 }
Beispiel #21
0
 private void btn_PlanIdQuery_Click(object sender, EventArgs e)
 {
     if (this.txt_PlanId.Text.Trim() == "")
     {
         MessageBox.Show("请输入要查询的计划单号", "计划单查询", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         this.txt_PlanId.Focus();
     }
     else
     {
         Sql2KDataAccess access = new Sql2KDataAccess();
         DataSet set = new DataSet();
         if (!this.cbx_Big.Checked)
         {
             set = access.Run_SqlText(this.PlanResult + " where PlanId='" + this.txt_PlanId.Text.Trim() + "' Order By PlanTime desc");
         }
         else
         {
             set = access.Run_SqlText(this.PlanResult + " where PlanId like '" + this.txt_PlanId.Text.Trim() + "%' Order By PlanTime desc");
         }
         this.dgv_Plan.DataSource = set.Tables[0];
         this.lab_Total.Text = "共查询到 " + set.Tables[0].Rows.Count.ToString() + " 条符合条件的记录";
     }
 }
Beispiel #22
0
 public static DataSet GetNpTypeDS()
 {
     Sql2KDataAccess access = new Sql2KDataAccess();
     DataSet set = new DataSet();
     return access.Run_SqlText("select Code,Description from V_nptype");
 }
Beispiel #23
0
 private void FrmPrintSendList_Load(object sender, EventArgs e)
 {
     List<User.PersonInfo> personInfoByUserName = User.GetPersonInfoByUserName(User.UserName);
     if (personInfoByUserName.Count > 0)
     {
         this.labelMakeperson.Text = "制表人 " + personInfoByUserName[0].TrueName;
     }
     this.labelMakeTime.Text = "制表时间 " + DateTime.Now;
     Sql2KDataAccess access = new Sql2KDataAccess();
     DataSet set = new DataSet();
     set = access.Run_SqlText("select * from d_code where codetype=8 and code='SendPerson'");
     try
     {
         this.textSendPerson.Text = set.Tables[0].Rows[0]["codename"].ToString();
     }
     catch
     {
         this.textSendPerson.Text = "程道民";
         string queryStr = "insert into d_code(code,codetype,codename,description) values('SendPerson',8,'" + this.textSendPerson.Text + "','送货人')";
         access.Run_SqlText(queryStr);
     }
     this.IsPreview = false;
 }
Beispiel #24
0
 private void AccountPan()
 {
     int num;
     int num2;
     Sql2KDataAccess access = new Sql2KDataAccess();
     DataSet set = new DataSet();
     string[] strArray = new string[9];
     string[] strArray2 = new string[9];
     string[] strArray3 = new string[9];
     string[] strArray4 = new string[9];
     int[,] numArray = new int[6, 9];
     strArray[0] = "清洗中";
     strArray[1] = "清洗好";
     strArray[2] = "贴白膜";
     strArray[3] = "贴黄膜";
     strArray[4] = "丝印好";
     strArray[5] = "冲孔好";
     for (num = 0; num < 6; num++)
     {
         num2 = 0;
         while (num2 < 9)
         {
             numArray[num, num2] = 0;
             num2++;
         }
     }
     Hashtable hashtable = new Hashtable();
     string queryStr = "select * from v_Mbtype";
     set = access.Run_SqlText(queryStr);
     if ((set != null) && (set.Tables[0].Rows.Count > 0))
     {
         for (num = 0; num < set.Tables[0].Rows.Count; num++)
         {
             hashtable.Add(Convert.ToInt32(set.Tables[0].Rows[num]["code"].ToString()), set.Tables[0].Rows[num]["CodeName"].ToString());
         }
     }
     string str2 = "SELECT SUM(pancount) as count FROM T_PanTaskInfo WHERE pancount>0 and";
     strArray2[5] = str2 + "  whiteoryellow='1'  and  (ClashU IS not NULL) GROUP BY Pantype";
     strArray2[4] = str2 + "  whiteoryellow='0' and (SilkScreenU IS not NULL) GROUP BY Pantype";
     strArray2[3] = str2 + "  whiteoryellow='1' and FilmU is not null and (ClashU IS NULL) GROUP BY Pantype";
     strArray2[2] = str2 + "  whiteoryellow='0' and FilmU is not null and (SilkScreenU IS NULL) GROUP BY Pantype";
     strArray2[1] = str2 + "  whiteoryellow is null  and cleanU is not null GROUP BY Pantype";
     strArray2[0] = str2 + "  whiteoryellow is null and cleanU is null  GROUP BY Pantype";
     strArray3[5] = str2 + " isinwarehouse='1' and  whiteoryellow='1'  and  (ClashU IS not NULL) ";
     strArray3[4] = str2 + " isinwarehouse='1' and whiteoryellow='0' and (SilkScreenU IS not NULL) ";
     strArray3[3] = str2 + " isinwarehouse='1' and whiteoryellow='1' and FilmU is not null and ClashU IS NULL ";
     strArray3[2] = str2 + " isinwarehouse='1' and whiteoryellow='0' and FilmU is not null and (SilkScreenU IS NULL) ";
     strArray3[1] = str2 + " isinwarehouse='1' and whiteoryellow is null  and cleanU is not null ";
     strArray3[0] = str2 + " isinwarehouse is null and whiteoryellow is null and cleanU is null ";
     strArray4[5] = str2 + " isinwarehouse='0' and whiteoryellow='1'  and  (ClashU IS not NULL) ";
     strArray4[4] = str2 + " isinwarehouse='0' and whiteoryellow='0' and (SilkScreenU IS not NULL) ";
     strArray4[3] = str2 + " isinwarehouse='0' and whiteoryellow='1' and FilmU is not null and (ClashU IS NULL) ";
     strArray4[2] = str2 + " isinwarehouse='0' and whiteoryellow='0' and FilmU is not null and (SilkScreenU IS NULL) ";
     strArray4[1] = str2 + " isinwarehouse='0' and whiteoryellow is null  and cleanU is not null ";
     strArray4[0] = str2 + " isinwarehouse='0' and whiteoryellow is null and cleanU is null  ";
     if (this.treeVwAccount.Nodes.ContainsKey("Pan"))
     {
         this.treeVwAccount.Nodes.RemoveByKey("Pan");
     }
     TreeNode node = this.treeVwAccount.Nodes.Add("Pan", "底板");
     long num3 = 0L;
     if ((set != null) && (set.Tables[0].Rows.Count > 0))
     {
         for (num = 0; num < set.Tables[0].Rows.Count; num++)
         {
             long num5;
             long num6;
             long num4 = num5 = num6 = 0L;
             TreeNode node2 = node.Nodes.Add("Pan" + set.Tables[0].Rows[num]["code"].ToString(), hashtable[Convert.ToInt32(set.Tables[0].Rows[num]["code"].ToString())].ToString());
             TreeNode node3 = node2.Nodes.Add("PanIn" + set.Tables[0].Rows[num]["code"].ToString(), "库中");
             num2 = 0;
             while (num2 < 6)
             {
                 long num7;
                 string str3 = strArray3[num2] + "and pantype='" + set.Tables[0].Rows[num]["code"].ToString() + "'";
                 DataSet set2 = access.Run_SqlText(str3);
                 try
                 {
                     num7 = Convert.ToInt64(set2.Tables[0].Rows[0]["count"].ToString());
                 }
                 catch
                 {
                     num7 = 0L;
                 }
                 if (num7 > 0L)
                 {
                     node3.Nodes.Add("PanInD" + num2.ToString(), strArray[num2] + "(" + num7.ToString() + ")");
                     num5 += num7;
                 }
                 num2++;
             }
             node3.Text = node3.Text + "(" + num5.ToString() + ")";
             num4 += num5;
             TreeNode node4 = node2.Nodes.Add("PanNotIn" + set.Tables[0].Rows[num]["code"].ToString(), "工序中");
             for (num2 = 0; num2 < 6; num2++)
             {
                 long num8;
                 string str4 = strArray4[num2] + "and pantype='" + set.Tables[0].Rows[num]["code"].ToString() + "'";
                 DataSet set3 = access.Run_SqlText(str4);
                 try
                 {
                     num8 = Convert.ToInt64(set3.Tables[0].Rows[0]["count"].ToString());
                 }
                 catch
                 {
                     num8 = 0L;
                 }
                 if (num8 > 0L)
                 {
                     node4.Nodes.Add("PanNotInD" + num2.ToString(), strArray[num2] + "(" + num8.ToString() + ")");
                     num6 += num8;
                 }
             }
             node4.Text = node4.Text + "(" + num6.ToString() + ")";
             num4 += num6;
             num3 += num4;
             node2.Text = node2.Text + "(" + num4.ToString() + ")";
         }
     }
     node.Text = node.Text + "(" + num3.ToString() + ")";
 }
Beispiel #25
0
 private void Frm_NpStat_Load(object sender, EventArgs e)
 {
     CpNpStat stat = new CpNpStat();
     Sql2KDataAccess access = new Sql2KDataAccess();
     DataSet ds = new DataSet();
     access.Run_SqlText(ref ds, "select Description ,TotalNum  from V_NpType t inner join (select Code,Count(NpId) as TotalNum from V_Np Where InPutTime between '" + this.m_FromDate.ToShortDateString() + "' and '" + this.ToDate.AddDays(1.0).ToShortDateString() + "'" + this.m_State + " Group By Code) t1 on t.Code=t1.Code", "V_NpStat");
     ParameterFields fields = new ParameterFields();
     ParameterField field = new ParameterField();
     ParameterDiscreteValue value2 = new ParameterDiscreteValue();
     field.ParameterFieldName="FromDate";
     value2.Value=this.m_FromDate.ToShortDateString();
     field.CurrentValues.Add(value2);
     fields.Add(field);
     field = new ParameterField();
     field.ParameterFieldName="ToDate";
     value2 = new ParameterDiscreteValue();
     value2.Value=this.m_ToDate.ToShortDateString();
     field.CurrentValues.Add(value2);
     fields.Add(field);
     field = new ParameterField();
     field.ParameterFieldName="State";
     value2 = new ParameterDiscreteValue();
     value2.Value=this.StateDesc;
     field.CurrentValues.Add(value2);
     fields.Add(field);
     this.crv_Send.ParameterFieldInfo=fields;
     stat.SetDataSource(ds);
     this.crv_Send.ReportSource=stat;
 }
Beispiel #26
0
 private void btnTaskPan_Click(object sender, EventArgs e)
 {
     if (this.txt_TaskId.Text.Trim() == "")
     {
         MessageBox.Show("请输入要查询的生产任务单号", "生产任务单查询", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         this.txt_TaskId.Focus();
     }
     else
     {
         Sql2KDataAccess access = new Sql2KDataAccess();
         DataSet set = new DataSet();
         string queryStr = this.WithdrawQueryHead + " WHERE (T_Task.TaskID = '" + this.txt_TaskId.Text.Trim() + "')";
         set = access.Run_SqlText(queryStr);
         this.dgv_Task.DataSource = set.Tables[0];
         this.lab_Total_Task.Text = "共查询到 " + set.Tables[0].Rows.Count.ToString() + " 条符合条件的记录";
         if ((set != null) && (set.Tables[0].Rows.Count > 0))
         {
             queryStr = this.MbTaskProcessQueryHead + " WHERE (T_WorkInfo.TaskID IN (SELECT T_WithdrawPan.PanTaskID FROM T_WithdrawPan INNER JOIN T_Task ON T_WithdrawPan.TaskID = T_Task.TaskID INNER JOIN V_MbType ON T_WithdrawPan.PanType = V_MbType.Code INNER JOIN T_User u1 ON T_WithdrawPan.WithdrawPerson = u1.UserName INNER JOIN T_User u2 ON T_WithdrawPan.OperatePerson = u2.UserName WHERE (T_Task.TaskID = '" + this.txt_TaskId.Text.Trim() + "'))) ORDER BY T_WorkInfo.TaskID, T_WorkInfo.ProcessID";
             DataSet set2 = access.Run_SqlText(queryStr);
             this.dgv_TaskDetail.DataSource = set2.Tables[0];
             this.splitDGD.Panel2Collapsed = false;
         }
     }
 }
Beispiel #27
0
 private void btnNullPrint_Click(object sender, EventArgs e)
 {
     FrmPrintSendList list = new FrmPrintSendList();
     Sql2KDataAccess access = new Sql2KDataAccess();
     DataSet set = access.Run_SqlText("select Code,CodeName from V_Depart");
     list.combPlanDepart.DataSource = set.Tables[0].DefaultView;
     list.combPlanDepart.DisplayMember = "CodeName";
     list.combPlanDepart.ValueMember = "CodeName";
     list.combPlanDepart.Refresh();
     set = access.Run_SqlText("select Code,CodeName from V_nptype");
     DataGridViewComboBoxColumn column = (DataGridViewComboBoxColumn) list.GridVwSendInfo.Columns[1];
     column.DataSource = set.Tables[0].DefaultView;
     column.DisplayMember = "codename";
     column.ValueMember = "codename";
     list.IsPreview = this.cbx_PrintSendView.Checked;
     list.ShowDialog();
 }
Beispiel #28
0
 private void btnTaskProcess_Click(object sender, EventArgs e)
 {
     this.splitDGD.Panel2Collapsed = true;
     if (this.txt_TaskId.Text.Trim() == "")
     {
         MessageBox.Show("请输入要查询的生产任务单号", "生产任务单查询", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         this.txt_TaskId.Focus();
     }
     else
     {
         Sql2KDataAccess access = new Sql2KDataAccess();
         DataSet set = new DataSet();
         string queryStr = this.TaskProcessQueryHead + " WHERE (T_Task.TaskID = '" + this.txt_TaskId.Text.Trim() + "')";
         set = access.Run_SqlText(queryStr);
         this.dgv_Task.DataSource = set.Tables[0];
         this.lab_Total_Task.Text = "共查询到 " + set.Tables[0].Rows.Count.ToString() + " 条符合条件的记录";
     }
 }
Beispiel #29
0
        private void listVwClickPan()
        {
            Sql2KDataAccess access = new Sql2KDataAccess();
            DataSet set = new DataSet();
            string[] strArray = new string[6];
            string[] strArray2 = new string[6];
            string str = "";
            if (this.treeVwAccount.SelectedNode.Name.Substring(0, 3).CompareTo("Pan") == 0)
            {
                string str2 = "SELECT PanTaskID AS 底板箱号, Pantype AS 底板尺寸, PanCount AS 数量, IsInWarehouse AS 是否在库中, CleanU AS 清洗人员, CleanTime AS 清洗时间,FilmU AS 贴膜人员, FilmTime AS 贴膜时间, SilkScreenU AS 丝印人员, SilkScreenTime AS 丝印时间, ClashU AS 冲孔人员, ClashTime AS 冲孔时间  FROM T_PanTaskInfo WHERE pancount>0 ";
                strArray[5] = " and isinwarehouse='1' and  whiteoryellow='1'  and  (ClashU IS not NULL) ";
                strArray[4] = " and isinwarehouse='1' and whiteoryellow='0' and (SilkScreenU IS not NULL) ";
                strArray[3] = " and isinwarehouse='1' and whiteoryellow='1' and FilmU is not null and ClashU IS NULL ";
                strArray[2] = " and isinwarehouse='1' and whiteoryellow='0' and FilmU is not null and (SilkScreenU IS NULL) ";
                strArray[1] = " and isinwarehouse='1' and whiteoryellow is null  and cleanU is not null ";
                strArray[0] = " and isinwarehouse is null and whiteoryellow is null and cleanU is null ";
                strArray2[5] = " and isinwarehouse='0' and whiteoryellow='1'  and  (ClashU IS not NULL) ";
                strArray2[4] = " and isinwarehouse='0' and whiteoryellow='0' and (SilkScreenU IS not NULL) ";
                strArray2[3] = " and isinwarehouse='0' and whiteoryellow='1' and FilmU is not null and (ClashU IS NULL) ";
                strArray2[2] = " and isinwarehouse='0' and whiteoryellow='0' and FilmU is not null and (SilkScreenU IS NULL) ";
                strArray2[1] = " and isinwarehouse='0' and whiteoryellow is null  and cleanU is not null ";
                strArray2[0] = " and isinwarehouse='0' and whiteoryellow is null and cleanU is null  ";
                switch (this.treeVwAccount.SelectedNode.Name.Length)
                {
                    case 3:
                        str = "";
                        break;

                    case 4:
                        str = " and Pantype='" + this.treeVwAccount.SelectedNode.Name.Substring(3, 1) + "'";
                        break;

                    case 6:
                        str = " and (isinwarehouse='1'or isinwarehouse is null) and Pantype='" + this.treeVwAccount.SelectedNode.Parent.Name.Substring(3, 1) + "'";
                        break;

                    case 7:
                        str = strArray[int.Parse(this.treeVwAccount.SelectedNode.Name.Substring(6, 1))] + " and Pantype='" + this.treeVwAccount.SelectedNode.Parent.Name.Substring(5, 1) + "'";
                        break;

                    case 9:
                        str = " and (isinwarehouse='0') and Pantype='" + this.treeVwAccount.SelectedNode.Parent.Name.Substring(3, 1) + "'";
                        break;

                    case 10:
                        str = strArray2[int.Parse(this.treeVwAccount.SelectedNode.Name.Substring(9, 1))] + " and Pantype='" + this.treeVwAccount.SelectedNode.Parent.Name.Substring(8, 1) + "'";
                        break;
                }
                set = access.Run_SqlText(str2 + str);
                if (set != null)
                {
                    this.dataGridView1.DataSource = set.Tables[0].DefaultView;
                    this.dataGridView1.Refresh();
                    this.labelResultInfo.Text = "一共查询到" + set.Tables[0].Rows.Count.ToString() + "记录!";
                    set = access.Run_SqlText("Select sum(pancount) as count FROM T_PanTaskInfo WHERE pancount>0 " + str);
                    this.labelResultInfo.Text = this.labelResultInfo.Text + "底板合计" + set.Tables[0].Rows[0]["count"].ToString();
                }
                else
                {
                    this.dataGridView1.DataSource = null;
                    this.dataGridView1.Rows.Clear();
                }
            }
        }
Beispiel #30
0
 public DataSet GetNpCountByPlanID(string PlanID)
 {
     object obj2 = new object();
     lock (obj2)
     {
         Sql2KDataAccess access = new Sql2KDataAccess();
         new Hashtable();
         DataSet set = new DataSet();
         string queryStr = "select nptype,count(*) Count from t_NP where planid='" + PlanID + "' group by nptype";
         return access.Run_SqlText(queryStr);
     }
 }