Esempio n. 1
0
 public Login()
 {
     Mylog.Error("打开");
     System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcessesByName("JssxSeizouPC");
     if (myProcesses.Length > 1)
     {
         foreach (System.Diagnostics.Process p in myProcesses)
         {
             p.Kill();
         }
     }
     InitializeComponent();
     GetLine();
 }
Esempio n. 2
0
 private void Cbx_Line_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (Cbx_Line.SelectedIndex < 0)
     {
         MessageBox.Show("请先选择客户!");
         return;
     }
     else
     {
         Mylog.Error("登陆成功");
         config.AppSettings.Settings["Lines"].Value     = Cbx_Line.SelectedValue.ToString();
         config.AppSettings.Settings["LinesName"].Value = sqlHelp.ExecuteDataSet(sqlHelp.ConnectionStringLocalTransaction, CommandType.Text, "select LineCode  from [dbo].[JSSX_Line]   where LineNumber='" + Cbx_Line.SelectedValue.ToString() + "' ").Tables[0].Rows[0]["LineCode"].ToString();
         config.AppSettings.Settings["Devices"].Value   = sqlHelp.ExecuteDataSet(sqlHelp.ConnectionStringLocalTransaction, CommandType.Text, "select Devices as  Devices from [dbo].[JSSX_Line] where LineNumber='" + Cbx_Line.SelectedValue.ToString() + "' ").Tables[0].Rows[0]["Devices"].ToString();
         config.Save();
         this.Hide();
         MainWindow lo = new MainWindow();
         lo.Show();
     }
 }
Esempio n. 3
0
        public static string GetData(string UniqueID, string InStockNumber, string WorkShift, string PrintNo, string Label, string SN, string Lines)
        {
            DataTable Dt = sqlHelp.ExecuteDataSet(sqlHelp.ConnectionStringLocalTransaction, CommandType.Text, "select distinct TrayVolume as 托收容,EuCode as 包装,IsPrinted^1 as 打印,line as 生产线,CONVERT(varchar(10),PlanTime, 23) as 计划日期,a.JSSXInsideCode as 背番,iif(EUCode<>0 and EUCode<>9 and EUCode<>10,KanbanAmount*TrayVolume,KanbanAmount) as 数量,a.JSSXCode as 社番,a.CustomerCode as 客番,c.CustomerInsideCode as 客户背番,InStockNumber as 指示单号,b.CreateTime as 创建时间,Creator as 创建者,[Version] as 版本,KanbanAmount as 需求看板,TrayVolume as 收容数,(select max(SerialNo) from JSSX_Stock_In_SerialNoRecord) as 流水号,c.UniqueID as 主键,iif(IsRepeated=1,1301,iif(IsRepeated=2,0101,d.CategoryNumber)) as 客户编码, (case c.TrayType when '量产' then 'B01L' when '补用品' then 'B01B' when '单纳品' then 'B01D' when '样品' then 'B01Y' when '特殊' then 'B01T' else 'ERROR' end) as 看板类型,CarType as 车型,ProName as 品名,iif(f.Name='广本' or f.Name='东本' ,'本田',f.Name) as 客户名称,Amount% Volume as 端数,EuCode as 箱种,EuName as 容器名称,iif(FreeOfCharge='True',1,0) as 有无偿,a.Note as 备注,g.WHCode as 中间仓编号,g.WHName as 仓库名称,h.WHCode as 中继仓编号,h.WHName as 中继仓名,e.Redistribute as 出货便名,e.CustomerCode as JCC客户代码,iif(LabelType='客户',1,0) as 销售模式 from [dbo].[JSSX_Stock_In_Detailed] as a left join [dbo].[JSSX_Stock_in] as b on a.instocknumber=b.Number  left join JSSX_Products c on a.UniqueID=c.UniqueID left join JSSX_Products_Category_Detailed d on d.UniqueID=a.UniqueID left join JSSX_Products_Category e on d.CategoryNumber=e.Number left join JSSX_Custom f on left(e.Number,2)=f.Number left join JSSX_WareHouse g on e.Warehouse = g.WHCode left join JSSX_WareHouse h on g.IntermediateWarehouse = h.WHCode where  InStockNumber= '" + InStockNumber + "' and a.UniqueID ='" + UniqueID + "'  and d.State is null and c.Revoked=0 and isdelete =0 ").Tables[0];
            string    SalesMode, EuName, RelayStation, WHLocation, Redistribute, Companynumber, WHCodeb, CustomerCode, Warehouse, WHName, EuCode, CustomerInsideCode, JCCCustomerNo, TrayVolume, JssxCode, JssxInsideCode, Amount, SerialNo, Volume, CustomerNo, UniqueNo, KanbanNo, TrayType, CData, CarType, ProName, Line, PlanTime, CustomerName, Complement, KanbanAoumt, FOC;

            TrayVolume = Dt.Rows[0]["托收容"].ToString();
            EuCode     = Dt.Rows[0]["包装"].ToString();
            TrayType   = Dt.Rows[0]["看板类型"].ToString();
            UniqueNo   = Dt.Rows[0]["主键"].ToString();
            Volume     = Int32.Parse(Dt.Rows[0]["收容数"].ToString()).ToString("0000");
            CustomerNo = Dt.Rows[0]["客户编码"].ToString();
            SalesMode  = Dt.Rows[0]["销售模式"].ToString();
            if (SN == "")
            {
                SerialNo = Int32.Parse(Dt.Rows[0]["流水号"].ToString()).ToString("00000000");
            }
            else
            {
                SerialNo = SN;
            }

            //JCC
            WHCodeb            = "";
            Warehouse          = Dt.Rows[0]["中间仓编号"].ToString();
            CustomerInsideCode = Dt.Rows[0]["客户背番"].ToString();
            JCCCustomerNo      = Dt.Rows[0]["JCC客户代码"].ToString();
            Companynumber      = "K0000004";//JSSX固定
            Redistribute       = Dt.Rows[0]["出货便名"].ToString();
            RelayStation       = "";
            WHLocation         = "";
            EuName             = Dt.Rows[0]["容器名称"].ToString();
            WHName             = Dt.Rows[0]["仓库名称"].ToString();
            //JCC

            JssxCode       = Dt.Rows[0]["社番"].ToString();
            CustomerCode   = Dt.Rows[0]["客番"].ToString();
            JssxInsideCode = Dt.Rows[0]["背番"].ToString();
            InStockNumber  = Dt.Rows[0]["指示单号"].ToString();
            Amount         = Dt.Rows[0]["数量"].ToString();
            CarType        = Dt.Rows[0]["车型"].ToString();
            ProName        = Dt.Rows[0]["品名"].ToString();
            Line           = Dt.Rows[0]["生产线"].ToString();
            PlanTime       = Dt.Rows[0]["计划日期"].ToString();
            CustomerName   = Dt.Rows[0]["客户名称"].ToString();
            Complement     = Dt.Rows[0]["端数"].ToString();
            KanbanAoumt    = Dt.Rows[0]["需求看板"].ToString();
            FOC            = Dt.Rows[0]["有无偿"].ToString();

            try
            {
                KanbanNo = "EU";
                CData    = QRData(SalesMode, Companynumber, WHCodeb, "0", "0", Warehouse, EuCode, CustomerCode, CustomerInsideCode, JCCCustomerNo, TrayType, JssxCode, CustomerNo, JssxInsideCode, "1", SerialNo, UniqueNo, InStockNumber, "E", FOC);
                createQRCode(InStockNumber + SerialNo, CData);
                CExcel(WHName, RelayStation, WHLocation, Redistribute, WHCodeb, Warehouse, EuName, TrayType, JssxCode, CustomerCode, JssxInsideCode, "1", SerialNo, UniqueNo, InStockNumber, KanbanNo, CarType, ProName, Line, PlanTime, CustomerName, PrintNo, FOC, Label);
                KanbanPrint_Web(InStockNumber, JssxInsideCode, PrintNo);
                SheetNo = 0;
                //sqlHelp.ExecuteSqlTran(sqlHelp.ConnectionStringLocalTransaction,  "update JSSX_Stock_In_Detailed set isprinted=1,EndNo= '" + SerialNo + "' where instocknumber='" + InStockNumber + "' and  UniqueID='" + UniqueNo + "' and  WorkShift='" + WorkShift + "'");
                return(UniqueNo + SerialNo);
            }
            catch (Exception ex)
            {
                Mylog.Error(ex.Message);
                return(ex.ToString());
            }
        }