private IEnumerator GameStart() { ClassSingleton <QuestData> .Instance.ClearDNGDataCache(); if (DataMng.Instance().RespDataCM_Login.penaltyUserInfo != null && DataMng.Instance().RespDataCM_Login.penaltyUserInfo.penaltyLevel == "2") { RestrictionInput.SuspensionLoad(); string @string = StringMaster.GetString("PenaltyTitle"); string message = DataMng.Instance().RespDataCM_Login.penaltyUserInfo.penalty.message; AlertManager.ShowAlertDialog(delegate(int x) { this.CancelGameStart(); }, @string, message, AlertManager.ButtonActionType.Close, false); yield break; } APIUtil.Instance().alertOnlyCloseButton = true; yield return(base.StartCoroutine(StoreInit.Instance().InitRestoreOperation())); if (!Loading.IsShow()) { RestrictionInput.StartLoad(RestrictionInput.LoadType.LARGE_IMAGE_MASK_ON); } APIUtil.Instance().alertOnlyCloseButton = false; AgreementConsent agreementConsent = new AgreementConsent(); bool isAgreement = false; yield return(base.StartCoroutine(agreementConsent.CheckAgreement(delegate(bool result) { isAgreement = result; }))); if (!isAgreement) { this.CancelGameStart(); yield break; } UpdateMasterData updateMasterData = new UpdateMasterData(); yield return(base.StartCoroutine(updateMasterData.UpdateData())); yield return(base.StartCoroutine(this.InitAssetBundleDownloadInfo())); bool tutorialStart = this.CheckFirstTutorial(); if (tutorialStart) { yield break; } bool isUpdate = this.UpdateAssetBundle(); if (isUpdate) { yield break; } ScreenController.ChangeHomeScreen(CMD_Tips.DISPLAY_PLACE.TitleToFarm); yield break; }
/// <summary> /// Асинхронный запуск сервера /// </summary> /// <returns></returns> public Task StartAsync() { return(Task.Factory.StartNew(() => { try { if (MessageEncryptionEnabled) { Console.WriteLine($"Server run on {Port} with encryption channel"); } else { Console.WriteLine($"Server run on {Port}"); } _listener.Start(); while (true) { TcpClient client = _listener.AcceptTcpClient(); Task.Factory.StartNew(() => { var fluffyClient = new FluffyClient(client, this); AddConnectedClient(fluffyClient); StoreInit?.Invoke(fluffyClient); NewClientConnected?.Invoke(fluffyClient); fluffyClient.Disconnected += client1 => { ClientDisconnected?.Invoke(client1); }; fluffyClient.NewData += (data) => { NewData?.Invoke(fluffyClient, data); }; fluffyClient.NewPacket += (ref int id, PacketParser <Packet> parser, FluffyClient xFuffyClient) => { NewPacket?.Invoke(ref id, parser, xFuffyClient); }; }); } } catch (Exception e) { Console.WriteLine(e.Message + " " + e.StackTrace); } })); }
private void consumeProductCallBackFailed(string err) { Singleton <DebugLogScreen> .Instance.Print(err); if (++this.svRetryCt >= 3) { int numFromProductId = this.GetNumFromProductId(this._productId); this.ShowErrorDialog(err); GUICollider.EnableAllCollider("StoreUtil"); StoreInit.Instance().SetStatusToReconsume(); return; } NpSingleton <NpPurchase> .Instance.SuccessPurchase(new Action(this.consumeProductCallBackSuccess), new Action <string>(this.consumeProductCallBackFailed)); }
private void PurchaseProductCallBackFail(string err) { global::Debug.Log("================================================= STORE PP_CALLBACK --> FAILED !!"); GUICollider.EnableAllCollider("StoreUtil"); this.ShowErrorDialog(err); Singleton <DebugLogScreen> .Instance.Print(err); int num = int.Parse(err); if (num == 405) { StoreInit.Instance().SetStatusToReconsume(); } }
private void OnUpdatedDigistone(bool isSuccess) { GUIPlayerStatus.RefreshParams_S(false); this.SetDigistoneNumber(); if (!isSuccess) { if (StoreInit.STATUS.DONE_RECONSUME > StoreInit.Instance().GetStatus()) { this.ClosePanel(true); } } else if (this.closeWhenConsumed) { this.ClosePanel(true); } }
private IEnumerator InitShop(Action <int> f, float sizeX, float sizeY, float aT) { yield return(base.StartCoroutine(StoreInit.Instance().InitStore())); yield return(base.StartCoroutine(StoreInit.Instance().InitRestoreOperation())); yield return(base.StartCoroutine(StoreInit.Instance().GetProductsOperation())); if (StoreInit.Instance().IsSuccessReceiveProducts() && StoreInit.STATUS.DONE_RECONSUME <= StoreInit.Instance().GetStatus()) { if (DataMng.Instance().RespDataSH_Info.isShopMaintenance == 1) { base.SetCloseAction(f); StoreInit.Instance().SetStatusToDoneInit(); AlertManager.ShowAlertDialog(delegate(int i) { this.< ClosePanel > __BaseCallProxy0(false); }, "C-SH05"); } else if (DataMng.Instance().RespDataSH_Info.isOverDigiStone == 1) { base.SetCloseAction(f); if (AlertManager.CheckDialogMessage("C-SH06")) { AlertManager.ShowAlertDialog(delegate(int i) { this.< ClosePanel > __BaseCallProxy0(false); }, "C-SH06"); } } else { base.ShowDLG(); base.PartsTitle.SetTitle(StringMaster.GetString("ShopTitle")); this.SetDigistoneNumber(); this.SetProductScrollView(); base.Show(f, sizeX, sizeY, aT); } } else { base.SetCloseAction(f); base.ClosePanel(false); } RestrictionInput.EndLoad(); yield break; }
public IEnumerator InitRestoreOperation() { string[] productsID = null; TaskBase productsID2 = StoreInit.Instance().GetProductsID(delegate(string[] IDs) { productsID = IDs; }); productsID2.Add(new NormalTask(delegate() { if (productsID != null) { return(StoreInit.Instance().GetProducts(productsID, true)); } return(null); })).Add(new NormalTask(StoreInit.Instance().ReConsume())); return(productsID2.Run(null, null, null)); }
private IEnumerator BuyRealStone(string productId, Action <bool> onCompleted) { RestrictionInput.StartLoad(RestrictionInput.LoadType.LARGE_IMAGE_MASK_ON); APIRequestTask apirequestTask = DataMng.Instance().RequestAgeCheck(productId, "3", false); apirequestTask.Add(new NormalTask(delegate() { if (DataMng.Instance().RespDataSH_AgeCheck.isShopMaintenance == 1) { StoreInit.Instance().SetStatusToDoneInit(); AlertManager.ShowAlertDialog(delegate(int nop) { if (null != CMD_Shop.instance) { CMD_Shop.instance.ClosePanel(true); } }, "C-SH05"); } else if (DataMng.Instance().RespDataSH_AgeCheck.isOverDigiStone == 1) { AlertManager.ShowAlertDialog(null, "C-SH06"); } else { if (DataMng.Instance().RespDataSH_AgeCheck.purchaseEnabled == 1) { return(this.StartPurchaseItem(productId, onCompleted)); } AlertManager.ShowAlertDialog(null, "C-SH04"); } return(null); })); TaskBase task = apirequestTask; if (GUIListPartsStone.< > f__mg$cache0 == null) { GUIListPartsStone.< > f__mg$cache0 = new Action(RestrictionInput.EndLoad); } return(task.Run(GUIListPartsStone.< > f__mg$cache0, delegate(Exception x) { RestrictionInput.EndLoad(); }, null)); }
private void VerifyReceiptFailed(Exception noop) { string noop2 = (noop == null) ? string.Empty : noop.Message; Singleton <DebugLogScreen> .Instance.Print(noop2); if (++this.svRetryCt < 3) { this.RequestPurchaseAndroid(); } else { global::Debug.Log("================================================= STORE VERIFY FAIL!!"); StoreInit.Instance().SetStatusToReconsume(); if (this.actCallBackReConsume != null) { this.actCallBackReConsume(false); } GUICollider.EnableAllCollider("StoreUtil"); } }
public IEnumerator GetProductsOperation() { string[] productsID = null; TaskBase productsID2 = StoreInit.Instance().GetProductsID(delegate(string[] IDs) { productsID = IDs; }); productsID2.Add(new NormalTask(delegate() { if (productsID != null) { return(StoreInit.Instance().GetProducts(productsID, false)); } return(StoreInit.Instance().GetProducts(productsID, false)); })); return(productsID2.Run(null, delegate(Exception nop) { this.getProductsSucceed = false; }, null)); }
//Microsoft.Office.Interop.Excel.Application app = null;// new Microsoft.Office.Interop.Excel.Application(); //Microsoft.Office.Interop.Excel.Workbooks wbs = null;// app.Workbooks; private void uploadExcelButton_Click(object sender, EventArgs e) { //Dictionary<string, string> realMaterialNum = new Dictionary<string, string>(); //解析xml,并把所以的料号与数量对上,其他类似之前的做法 //try //{ // app = new Microsoft.Office.Interop.Excel.Application(); // wbs = app.Workbooks; // Microsoft.Office.Interop.Excel.Workbook wb = wbs.Open(pathTextBox.Text, 0, false, 5, string.Empty, string.Empty, // false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, // string.Empty, true, false, 0, true, 1, 0); // app.DisplayAlerts = false; // Microsoft.Office.Interop.Excel.Worksheet ws = wb.Worksheets["Sheet1"]; // int rowLength = ws.UsedRange.Rows.Count; // int columnLength = ws.UsedRange.Columns.Count; // for (int i = 2; i <= rowLength; i++) // { // string mpn = "", number = ""; // //有可能有空值 // mpn = ((Microsoft.Office.Interop.Excel.Range)ws.Cells[i, 1]).Value2.ToString(); // number = ((Microsoft.Office.Interop.Excel.Range)ws.Cells[i, 6]).Value2.ToString(); // if (mpn.Trim() == "" || number.Trim() == "") // { // MessageBox.Show("数量或料号有空值"); // break; // } // realMaterialNum.Add(mpn.Trim(), number.Trim()); // } //}catch(Exception ex) //{ // MessageBox.Show(ex.ToString()); //} //finally //{ // closeAndKillApp(); //} //下面把内容按之前的方式生成 DateTime time1 = Convert.ToDateTime(this.dateTimePickerstart.Value.Date.ToString("yyyy/MM/dd")); DateTime time2 = Convert.ToDateTime(this.dateTimePickerend.Value.Date.ToString("yyyy/MM/dd")); if (DateTime.Compare(time1, time2) > 0) //判断日期大小 { MessageBox.Show("开始日期大于结束"); return; } string startTime = this.dateTimePickerstart.Value.ToString("yyyy/MM/dd"); string endTime = this.dateTimePickerend.Value.ToString("yyyy/MM/dd"); OpeningStockClass openingstock = new OpeningStockClass(); List <StoreInit> storeInitList = new List <StoreInit>(); List <StockCheck> StockCheckList = new List <StockCheck>(); string seq_no = DateTime.Now.ToString("yyyyMMdd") + "2005" + "1"; //日期+类型+序号 string boxtype = "2005"; //代码 string flowstateg = ""; string trade_code = ""; string ems_no = ""; string status = "A"; try { SqlConnection mConn = new SqlConnection(Constlist.ConStr); mConn.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = mConn; cmd.CommandType = CommandType.Text; //查询71bom Dictionary <string, string> _71bomDic = new Dictionary <string, string>(); Dictionary <string, string> _71bomDescribeDic = new Dictionary <string, string>();//料号与描述对应 cmd.CommandText = "select distinct material_mpn,material_vendor_pn,_description from LCFC71BOM_table"; SqlDataReader querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { if (_71bomDic.ContainsKey(querySdr[0].ToString().Trim()) == false) { _71bomDic.Add(querySdr[0].ToString().Trim(), querySdr[1].ToString().Trim()); } if (_71bomDescribeDic.ContainsKey(querySdr[0].ToString().Trim()) == false) { _71bomDescribeDic.Add(querySdr[0].ToString().Trim(), querySdr[2].ToString().Trim()); } } querySdr.Close(); //查询物料对照表 Dictionary <string, string> materialbomDic = new Dictionary <string, string>(); cmd.CommandText = "select distinct custommaterialNo,vendormaterialNo from MBMaterialCompare"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { if (materialbomDic.ContainsKey(querySdr[0].ToString().Trim()) == false) { materialbomDic.Add(querySdr[0].ToString().Trim(), querySdr[1].ToString().Trim()); } } querySdr.Close(); cmd.CommandText = "select indentifier, book_number from company_fixed_table"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { trade_code = querySdr[0].ToString(); ems_no = querySdr[1].ToString(); } querySdr.Close(); Dictionary <string, int> receiveOrderDic = new Dictionary <string, int>(); //1 从收货表中查询信息 cmd.CommandText = "select custom_materialNo, receivedNum,returnNum,cid_number from receiveOrder where _status !='return'"; querySdr = cmd.ExecuteReader(); int receiveNum = 0, returnNum = 0, cidNum = 0; while (querySdr.Read()) { receiveNum = Int32.Parse(querySdr[1].ToString()); try { returnNum = Int32.Parse(querySdr[2].ToString()); } catch (Exception ex) { returnNum = 0; } try { cidNum = Int32.Parse(querySdr[3].ToString()); } catch (Exception ex) { cidNum = 0; } if (receiveOrderDic.ContainsKey(querySdr[0].ToString())) { //加上原来的数量 receiveOrderDic[querySdr[0].ToString()] = receiveOrderDic[querySdr[0].ToString()] + receiveNum - returnNum - cidNum; } else { receiveOrderDic.Add(querySdr[0].ToString(), receiveNum - returnNum - cidNum); } } querySdr.Close(); foreach (KeyValuePair <string, int> kvp in receiveOrderDic) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; string temp = kvp.Key; if (temp.Length == 10 && temp.StartsWith("000")) { temp = temp.Substring(3); } init1.cop_g_no = temp; //维修的板子,使用客户料号 init1.qty = kvp.Value.ToString(); init1.unit = "007"; //固定单位 init1.goods_nature = "I"; //代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); } //2 读取良品库房信息 Dictionary <string, string> mpn_unit = new Dictionary <string, string>(); cmd.CommandText = "select distinct mpn,declare_unit from stock_in_sheet where mpn !=''"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { if (mpn_unit.ContainsKey(querySdr[0].ToString()) == false) { mpn_unit.Add(querySdr[0].ToString(), querySdr[1].ToString()); } } querySdr.Close(); cmd.CommandText = "select mpn, number,house,place from store_house where mpn !='' and number !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; string currentDeclear = ""; bool isMB = false; if (_71bomDic.ContainsKey(querySdr[0].ToString())) { currentDeclear = _71bomDic[querySdr[0].ToString()]; } else if (currentDeclear == "") { currentDeclear = querySdr[0].ToString();//buffer主板直接用71料号存储的 if (currentDeclear.Length == 10 && currentDeclear.StartsWith("000")) { currentDeclear = currentDeclear.Substring(3); isMB = true; } } init1.cop_g_no = currentDeclear;//因为报关原因,需要改成71料号(联想料号)TODO,包括材料与买的MB,物料对照表与71bom init1.qty = querySdr[1].ToString(); try { init1.unit = Untils.getCustomCode(mpn_unit[querySdr[0].ToString()]); } catch (Exception ex) { init1.unit = "007"; } init1.goods_nature = "I";//代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); } querySdr.Close(); //3 读取MB/SMT/BGA不良品信息,此处的MB是由CID过来的,所以直接用原始料号即可 cmd.CommandText = "select mpn, number,house,place from store_house_ng where mpn !='' and number !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; string currentDeclear = ""; bool isMB = false; if (_71bomDic.ContainsKey(querySdr[0].ToString())) { currentDeclear = _71bomDic[querySdr[0].ToString()] + "-1";//海关要求料号不一样,加-1 } else if (currentDeclear == "") { currentDeclear = querySdr[0].ToString();//buffer主板直接用71料号存储的 if (currentDeclear.Length == 10 && currentDeclear.StartsWith("000")) { currentDeclear = currentDeclear.Substring(3); isMB = true; } } init1.cop_g_no = currentDeclear;//因为报关原因,需要改成71料号(联想料号)TODO init1.qty = querySdr[1].ToString(); try { init1.unit = Untils.getCustomCode(mpn_unit[querySdr[0].ToString()]); } catch (Exception ex) { init1.unit = "007"; } init1.goods_nature = "I";//代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); } querySdr.Close(); //3-1 读取MB Buffer不良品信息,此处的MB是由良品库过来的,所以直接用原始料号71即可 cmd.CommandText = "select mpn, number,house,place from store_house_ng_buffer_mb where mpn !='' and number !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; string currentDeclear = querySdr[0].ToString().Trim(); init1.cop_g_no = currentDeclear;//因为报关原因,需要改成71料号(联想料号)TODO init1.qty = querySdr[1].ToString(); try { init1.unit = Untils.getCustomCode(mpn_unit[querySdr[0].ToString()]); } catch (Exception ex) { init1.unit = "007"; } init1.goods_nature = "I";//代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); } querySdr.Close(); //4 读取MB待维修库信息 cmd.CommandText = "select custom_materialNo,leftNumber from wait_repair_left_house_table where leftNumber !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; string temp = querySdr[0].ToString(); if (temp.Length == 10 && temp.StartsWith("000")) { temp = temp.Substring(3); } init1.cop_g_no = temp; //正常使用客户料号 init1.qty = querySdr[1].ToString(); init1.unit = "007"; //固定单位 init1.goods_nature = "I"; //代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); } querySdr.Close(); //5 读取MB良品库信息 cmd.CommandText = "select custom_materialNo, leftNumber from repaired_left_house_table where leftNumber !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; string temp = querySdr[0].ToString(); if (temp.Length == 10 && temp.StartsWith("000")) { temp = temp.Substring(3); } init1.cop_g_no = temp; //正常使用客户料号 init1.qty = querySdr[1].ToString(); init1.unit = "007"; //固定单位 init1.goods_nature = "I"; //代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); } querySdr.Close(); mConn.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } openingstock.seq_no = seq_no; openingstock.boxtype = boxtype; openingstock.flowstateg = flowstateg; openingstock.trade_code = trade_code; openingstock.ems_no = ems_no; openingstock.status = status; openingstock.storeInitList = storeInitList; if (storeInitList.Count > 0) { Untils.createOpeningStockXML(openingstock, "D:\\STORE_INIT" + seq_no + ".xml"); MessageBox.Show("海关期初库存信息产生成功!"); } else { MessageBox.Show("没有期初库存信息!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void exportxmlbutton_Click(object sender, EventArgs e) { DateTime time1 = Convert.ToDateTime(this.dateTimePickerstart.Value.Date.ToString("yyyy/MM/dd")); DateTime time2 = Convert.ToDateTime(this.dateTimePickerend.Value.Date.ToString("yyyy/MM/dd")); if (DateTime.Compare(time1, time2) > 0) //判断日期大小 { MessageBox.Show("开始日期大于结束"); return; } string startTime = this.dateTimePickerstart.Value.ToString("yyyy/MM/dd"); string endTime = this.dateTimePickerend.Value.ToString("yyyy/MM/dd"); OpeningStockClass openingstock = new OpeningStockClass(); List <StoreInit> storeInitList = new List <StoreInit>(); List <StockCheck> StockCheckList = new List <StockCheck>(); string seq_no = DateTime.Now.ToString("yyyyMMdd") + "2005" + "1"; //日期+类型+序号 string boxtype = "2005"; //代码 string flowstateg = ""; string trade_code = ""; string ems_no = ""; string status = "A"; try { SqlConnection mConn = new SqlConnection(Constlist.ConStr); mConn.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = mConn; cmd.CommandType = CommandType.Text; //查询71bom Dictionary <string, string> _71bomDic = new Dictionary <string, string>(); Dictionary <string, string> _71bomDescribeDic = new Dictionary <string, string>();//料号与描述对应 cmd.CommandText = "select distinct material_mpn,material_vendor_pn,_description from LCFC71BOM_table"; SqlDataReader querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { if (_71bomDic.ContainsKey(querySdr[0].ToString().Trim()) == false) { _71bomDic.Add(querySdr[0].ToString().Trim(), querySdr[1].ToString().Trim()); } if (_71bomDescribeDic.ContainsKey(querySdr[0].ToString().Trim()) == false) { _71bomDescribeDic.Add(querySdr[0].ToString().Trim(), querySdr[2].ToString().Trim()); } } querySdr.Close(); //查询物料对照表 Dictionary <string, string> materialbomDic = new Dictionary <string, string>(); cmd.CommandText = "select distinct custommaterialNo,vendormaterialNo from MBMaterialCompare"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { if (materialbomDic.ContainsKey(querySdr[0].ToString().Trim()) == false) { materialbomDic.Add(querySdr[0].ToString().Trim(), querySdr[1].ToString().Trim()); } } querySdr.Close(); cmd.CommandText = "select indentifier, book_number from company_fixed_table"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { trade_code = querySdr[0].ToString(); ems_no = querySdr[1].ToString(); } querySdr.Close(); Dictionary <string, int> receiveOrderDic = new Dictionary <string, int>(); //1 从收货表中查询信息 cmd.CommandText = "select custom_materialNo, receivedNum,returnNum,cid_number from receiveOrder where _status !='return'"; querySdr = cmd.ExecuteReader(); int receiveNum = 0, returnNum = 0, cidNum = 0; while (querySdr.Read()) { receiveNum = Int32.Parse(querySdr[1].ToString()); try { returnNum = Int32.Parse(querySdr[2].ToString()); } catch (Exception ex) { returnNum = 0; } try { cidNum = Int32.Parse(querySdr[3].ToString()); } catch (Exception ex) { cidNum = 0; } if (receiveOrderDic.ContainsKey(querySdr[0].ToString())) { //加上原来的数量 receiveOrderDic[querySdr[0].ToString()] = receiveOrderDic[querySdr[0].ToString()] + receiveNum - returnNum - cidNum; } else { receiveOrderDic.Add(querySdr[0].ToString(), receiveNum - returnNum - cidNum); } } querySdr.Close(); foreach (KeyValuePair <string, int> kvp in receiveOrderDic) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; string temp = kvp.Key; if (temp.Length == 10 && temp.StartsWith("000")) { temp = temp.Substring(3); } init1.cop_g_no = temp; //维修的板子,使用客户料号 init1.qty = kvp.Value.ToString(); init1.unit = "007"; //固定单位 init1.goods_nature = "I"; //代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); StockCheck stockcheck = new StockCheck(); stockcheck.material_no = temp; stockcheck.num = kvp.Value.ToString(); stockcheck.house = "成品之前"; stockcheck.place = ""; stockcheck.describe = "维修中主板"; if (stockcheck.num != "0") { StockCheckList.Add(stockcheck); } } //2 读取良品库房信息 Dictionary <string, string> mpn_unit = new Dictionary <string, string>(); cmd.CommandText = "select distinct mpn,declare_unit from stock_in_sheet where mpn !=''"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { if (mpn_unit.ContainsKey(querySdr[0].ToString()) == false) { mpn_unit.Add(querySdr[0].ToString(), querySdr[1].ToString()); } } querySdr.Close(); cmd.CommandText = "select mpn, number,house,place from store_house where mpn !='' and number !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; string currentDeclear = ""; bool isMB = false; if (_71bomDic.ContainsKey(querySdr[0].ToString())) { currentDeclear = _71bomDic[querySdr[0].ToString()]; } else if (currentDeclear == "") { currentDeclear = querySdr[0].ToString();//buffer主板直接用71料号存储的 if (currentDeclear.Length == 10 && currentDeclear.StartsWith("000")) { currentDeclear = currentDeclear.Substring(3); isMB = true; } } init1.cop_g_no = currentDeclear;//因为报关原因,需要改成71料号(联想料号)TODO,包括材料与买的MB,物料对照表与71bom init1.qty = querySdr[1].ToString(); try { init1.unit = Untils.getCustomCode(mpn_unit[querySdr[0].ToString()]); } catch (Exception ex) { init1.unit = "007"; } init1.goods_nature = "I";//代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); StockCheck stockcheck = new StockCheck(); stockcheck.material_no = isMB ? currentDeclear:querySdr[0].ToString(); stockcheck.num = querySdr[1].ToString(); stockcheck.house = querySdr[2].ToString(); stockcheck.place = querySdr[3].ToString(); if (_71bomDescribeDic.ContainsKey(stockcheck.material_no)) { stockcheck.describe = _71bomDescribeDic[stockcheck.material_no]; } if (stockcheck.num != "0") { StockCheckList.Add(stockcheck); } } querySdr.Close(); //3 读取MB/SMT/BGA不良品信息,此处的MB是由CID过来的,所以直接用原始料号即可 cmd.CommandText = "select mpn, number,house,place from store_house_ng where mpn !='' and number !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; string currentDeclear = ""; bool isMB = false; if (_71bomDic.ContainsKey(querySdr[0].ToString())) { currentDeclear = _71bomDic[querySdr[0].ToString()] + "-1";//海关要求料号不一样,加-1 } else if (currentDeclear == "") { currentDeclear = querySdr[0].ToString();//buffer主板直接用71料号存储的 if (currentDeclear.Length == 10 && currentDeclear.StartsWith("000")) { currentDeclear = currentDeclear.Substring(3); isMB = true; } } init1.cop_g_no = currentDeclear;//因为报关原因,需要改成71料号(联想料号)TODO init1.qty = querySdr[1].ToString(); try { init1.unit = Untils.getCustomCode(mpn_unit[querySdr[0].ToString()]); } catch (Exception ex) { init1.unit = "007"; } init1.goods_nature = isMB? "E" :"I";//代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); StockCheck stockcheck = new StockCheck(); stockcheck.material_no = isMB ? currentDeclear : querySdr[0].ToString(); stockcheck.num = querySdr[1].ToString(); stockcheck.house = querySdr[2].ToString(); stockcheck.place = querySdr[3].ToString(); if (_71bomDescribeDic.ContainsKey(stockcheck.material_no)) { stockcheck.describe = _71bomDescribeDic[stockcheck.material_no]; } else { stockcheck.describe = isMB ? "不良品主板" : ""; } stockcheck.material_no += "_1";//区分良品与不良品信息 if (stockcheck.num != "0") { StockCheckList.Add(stockcheck); } } querySdr.Close(); //3-1 读取MB Buffer不良品信息,此处的MB是由良品库过来的,所以直接用原始料号71即可 cmd.CommandText = "select mpn, number,house,place from store_house_ng_buffer_mb where mpn !='' and number !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; string currentDeclear = querySdr[0].ToString().Trim(); init1.cop_g_no = currentDeclear;//因为报关原因,需要改成71料号(联想料号)TODO init1.qty = querySdr[1].ToString(); try { init1.unit = Untils.getCustomCode(mpn_unit[querySdr[0].ToString()]); } catch (Exception ex) { init1.unit = "007"; } init1.goods_nature = "E";//代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); StockCheck stockcheck = new StockCheck(); stockcheck.material_no = currentDeclear; stockcheck.num = querySdr[1].ToString(); stockcheck.house = querySdr[2].ToString(); stockcheck.place = querySdr[3].ToString(); if (_71bomDescribeDic.ContainsKey(stockcheck.material_no)) { stockcheck.describe = _71bomDescribeDic[stockcheck.material_no]; } stockcheck.material_no += "_1";//区分良品与不良品信息 if (stockcheck.num != "0") { StockCheckList.Add(stockcheck); } } querySdr.Close(); //4 读取MB待维修库信息 cmd.CommandText = "select custom_materialNo,leftNumber from wait_repair_left_house_table where leftNumber !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; string temp = querySdr[0].ToString(); if (temp.Length == 10 && temp.StartsWith("000")) { temp = temp.Substring(3); } init1.cop_g_no = temp; //正常使用客户料号 init1.qty = querySdr[1].ToString(); init1.unit = "007"; //固定单位 init1.goods_nature = "I"; //代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); StockCheck stockcheck = new StockCheck(); stockcheck.material_no = temp; stockcheck.num = querySdr[1].ToString(); stockcheck.house = "待维修库"; stockcheck.place = ""; stockcheck.describe = "待维修主板"; if (stockcheck.num != "0") { StockCheckList.Add(stockcheck); } } querySdr.Close(); //5 读取MB良品库信息 cmd.CommandText = "select custom_materialNo, leftNumber from repaired_left_house_table where leftNumber !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; string temp = querySdr[0].ToString(); if (temp.Length == 10 && temp.StartsWith("000")) { temp = temp.Substring(3); } init1.cop_g_no = temp; //正常使用客户料号 init1.qty = querySdr[1].ToString(); init1.unit = "007"; //固定单位 init1.goods_nature = "E"; //代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); StockCheck stockcheck = new StockCheck(); stockcheck.material_no = temp; stockcheck.num = querySdr[1].ToString(); stockcheck.house = "良品库"; stockcheck.place = ""; stockcheck.describe = "维修后良品主板"; if (stockcheck.num != "0") { StockCheckList.Add(stockcheck); } } querySdr.Close(); mConn.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } generateExcelToCheck(StockCheckList); openingstock.seq_no = seq_no; openingstock.boxtype = boxtype; openingstock.flowstateg = flowstateg; openingstock.trade_code = trade_code; openingstock.ems_no = ems_no; openingstock.status = status; openingstock.storeInitList = storeInitList; //导出xml的逻辑变成excel上传了 if (storeInitList.Count > 0) { Untils.createOpeningStockXML(openingstock, "D:\\STORE_INIT" + seq_no + "test.xml"); MessageBox.Show("海关期初库存信息产生成功!"); } else { MessageBox.Show("没有期初库存信息!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void exportxmlbutton_Click(object sender, EventArgs e) { DateTime time1 = Convert.ToDateTime(this.dateTimePickerstart.Value.Date.ToString("yyyy/MM/dd")); DateTime time2 = Convert.ToDateTime(this.dateTimePickerend.Value.Date.ToString("yyyy/MM/dd")); if (DateTime.Compare(time1, time2) > 0) //判断日期大小 { MessageBox.Show("开始日期大于结束"); return; } string startTime = this.dateTimePickerstart.Value.ToString("yyyy/MM/dd"); string endTime = this.dateTimePickerend.Value.ToString("yyyy/MM/dd"); OpeningStockClass openingstock = new OpeningStockClass(); List <StoreInit> storeInitList = new List <StoreInit>(); string seq_no = DateTime.Now.ToString("yyyyMMdd") + "2005" + "02"; //日期+类型+序号 01代表维修, 02代表整机 string boxtype = "2005"; //代码 string flowstateg = ""; string trade_code = ""; string ems_no = ""; trade_code = "3401560011"; ems_no = "H33138000002"; string status = "A"; try { SqlConnection mConn = new SqlConnection(Conlist.ConStr); mConn.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = mConn; cmd.CommandType = CommandType.Text; Dictionary <string, string> nameDir = new Dictionary <string, string>(); cmd.CommandText = "select distinct SKU_LNO,SKU_NO from BOMCompare"; SqlDataReader querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { if (nameDir.ContainsKey(querySdr[0].ToString().Trim()) == false) { nameDir.Add(querySdr[0].ToString().Trim(), querySdr[1].ToString().Trim()); } } querySdr.Close(); //1 读取材料库房信息 cmd.CommandText = "select materialNo,number from materialhouse where materialNo!='' and number !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; init1.cop_g_no = querySdr[0].ToString(); init1.qty = querySdr[1].ToString(); init1.unit = "007"; init1.goods_nature = "I";//代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); } querySdr.Close(); //2 读取在维修的整机,还没有走到包装步骤 Dictionary <string, int> reparingNum = new Dictionary <string, int>(); cmd.CommandText = "select SKU from NBShouLiao where receiveDate !='' and PackDate is NULL"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { if (reparingNum.ContainsKey(querySdr[0].ToString().Trim())) { reparingNum[querySdr[0].ToString().Trim()] = reparingNum[querySdr[0].ToString().Trim()] + 1; } else { reparingNum[querySdr[0].ToString().Trim()] = 1; } } querySdr.Close(); foreach (string key in reparingNum.Keys) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; init1.cop_g_no = nameDir[key]; init1.qty = reparingNum[key] + ""; init1.unit = "001"; init1.goods_nature = "I";//代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); } //2 整机良品库 cmd.CommandText = "select model,number from NBHouse where model!='' and number !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; init1.cop_g_no = nameDir[querySdr[0].ToString()]; init1.qty = querySdr[1].ToString(); init1.unit = "001"; init1.goods_nature = "E";//代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); } querySdr.Close(); //3 材料不良品库房 cmd.CommandText = "select materialNo,number from materialNgHouse where materialNo!='' and number !='0'"; querySdr = cmd.ExecuteReader(); while (querySdr.Read()) { StoreInit init1 = new StoreInit(); init1.ems_no = ems_no; init1.cop_g_no = querySdr[0].ToString(); init1.qty = querySdr[1].ToString(); init1.unit = "007"; init1.goods_nature = "I";//代码 init1.bom_version = ""; init1.check_date = Untils.getCustomCurrentDate(); init1.date_type = "C";//代码 init1.whs_code = ""; init1.location_code = ""; init1.note = ""; storeInitList.Add(init1); } querySdr.Close(); mConn.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } openingstock.seq_no = seq_no; openingstock.boxtype = boxtype; openingstock.flowstateg = flowstateg; openingstock.trade_code = trade_code; openingstock.ems_no = ems_no; openingstock.status = status; openingstock.storeInitList = storeInitList; if (storeInitList.Count > 0) { Untils.createOpeningStockXML(openingstock, "D:\\STORE_INIT" + seq_no + ".xml"); MessageBox.Show("海关期初库存信息产生成功!"); } else { MessageBox.Show("没有期初库存信息!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected virtual void OnDestroy() { StoreInit.instance = null; }
protected virtual void Awake() { StoreInit.instance = this; }
private IEnumerator StartEvent() { RestrictionInput.StartLoad(RestrictionInput.LoadType.LARGE_IMAGE_MASK_OFF); ClassSingleton <MonsterUserDataMng> .Instance.Initialize(); GUIMonsterIcon.InitMonsterGO(Singleton <GUIMain> .Instance.transform); ClassSingleton <GUIMonsterIconList> .Instance.Initialize(); yield return(base.StartCoroutine(AssetBundleMng.Instance().WaitCacheReady())); yield return(base.StartCoroutine(StoreInit.Instance().InitStore())); this.googlePlay.Bootup(); yield return(base.StartCoroutine(this.AuthLogin())); yield return(base.StartCoroutine(APIUtil.Instance().StartGameLogin())); if (DataMng.Instance().RespDataCM_Login == null) { SoundMng.Instance().PlayBGM("BGMInternal/bgm_103/sound", 0.3f, null); this.screenCollider.playOkSE = false; this.switchTitleImage(GUIScreenTitle.TitleStete.returnVal); RestrictionInput.EndLoad(); GUIFadeControll.ActionRestart(); yield break; } this.titleState = (GUIScreenTitle.TitleStete)DataMng.Instance().RespDataCM_Login.state; this.switchTitleImage(this.titleState); GUIFadeControll.ActionRestart(); string responseContactCode = PlayerPrefs.GetString("InquiryCode", string.Empty); if (string.IsNullOrEmpty(responseContactCode)) { GameWebAPI.RequestCM_InquiryCodeRequest requestCM_InquiryCodeRequest = new GameWebAPI.RequestCM_InquiryCodeRequest(); requestCM_InquiryCodeRequest.OnReceived = delegate(GameWebAPI.InquiryCodeRequest response) { PlayerPrefs.SetString("InquiryCode", response.inquiryCode); }; GameWebAPI.RequestCM_InquiryCodeRequest request = requestCM_InquiryCodeRequest; yield return(base.StartCoroutine(request.Run(null, null, null))); } this.userID.gameObject.SetActive(true); this.userCode.gameObject.SetActive(true); this.appVersion.gameObject.SetActive(true); this.buildNumLabel.gameObject.SetActive(true); this.NpVersion.gameObject.SetActive(true); this.userCode.text = string.Format(StringMaster.GetString("TitleUserCode"), DataMng.Instance().RespDataCM_Login.playerInfo.userCode); this.appVersion.text = string.Format(StringMaster.GetString("TitleAppVersion"), VersionManager.version); GameWebAPI.RespDataCM_Login.TutorialStatus tutorialStatus = DataMng.Instance().RespDataCM_Login.tutorialStatus; if ("0" == tutorialStatus.endFlg && "0" == tutorialStatus.statusId) { this.cacheClearButtonCollider.enabled = false; this.cacheClearButtonLabel.color = Color.gray; this.cacheClearButtonLabel.effectColor = Color.gray; this.cacheClearButtonSprite.spriteName = "Common02_Btn_BaseG"; } yield return(this.backup.CheckClearMissionForGoogle()); if (GUICollider.IsAllColliderDisable()) { GUICollider.EnableAllCollider(string.Empty); } RestrictionInput.EndLoad(); if ("0" != tutorialStatus.endFlg) { CMD_BaseSelect.LoadSetting(); CMD_ChipSortModal.LoadSetting(); } yield break; }