private void SyncHhtForm_Click(object sender, EventArgs e) { try { // SyncHhtForm form; if (!formPool.ContainsKey(SyncHandheldScreen)) { //form = new SyncHhtForm(UserName); syncForm.MdiParent = this; permissionComponent.SetPermissionComponentByScreen(syncForm); formPool.Add(SyncHandheldScreen, syncForm); } else { syncForm = (SyncHhtForm)formPool[SyncHandheldScreen]; } syncForm.Show(); syncForm.FormClosing += new FormClosingEventHandler(validationForm_FormClosing); syncForm.WindowState = FormWindowState.Minimized; syncForm.WindowState = FormWindowState.Maximized; } catch (Exception ex) { log.Error(String.Format("Exception : {0}", ex.StackTrace)); } }
//public void SetAutoUploadGrid() //{ // HHTSyncBll hhtBll = new HHTSyncBll(); // SyncHhtForm otherForm = new SyncHhtForm(); // List<AuditStocktakingModel> auditListFormTemp = hhtBll.GetAuditTempList(); // try // { // List<AuditStocktakingModel> auditListTempGroupLocation = auditListFormTemp.GroupBy(x => x.LocationCode).Select(g => g.First()).ToList(); // int row = 0; // foreach (AuditStocktakingModel data in auditListTempGroupLocation) // { // int countLocation = (from a in auditListFormTemp // where a.LocationCode == data.LocationCode // select a).Count(); // decimal sumQTY = (from a in auditListFormTemp // where a.LocationCode == data.LocationCode // select a.Quantity).Sum(); // string[] splitFileName = data.FileName.Split('\\'); // string fileName = splitFileName[splitFileName.Count() - 1]; // otherForm.dataGridViewAutoUp.Rows.Add(data.HHTID, data.HHTName, data.CreateBy, fileName, data.LocationCode, Convert.ToString(countLocation), Convert.ToString((int)sumQTY), "Not Start", "Waiting"); // //dataGridViewAutoUp.Rows[row].Cells[7] = new TextAndIconCell(); // //dataGridViewAutoUp.Rows[row].Cells[7].Value = "Not Start"; // //dataGridViewAutoUp.Rows[row].Cells[8] = new TextAndIconCell(); // //dataGridViewAutoUp.Rows[row].Cells[8].Value = "Waiting"; // row++; // } // foreach (AuditStocktakingModel auditTemp in auditListFormTemp) // { // string[] splitFileName = auditTemp.FileName.Split('\\'); // string fileName = splitFileName[splitFileName.Count() - 1]; // } // } // catch (Exception ex) // { // } //} #region Form Events private void LayoutWmenu_Load(object sender, EventArgs e) { try { this.MainMenuStrip = new MenuStrip(); permissionComponent = new PermissionComponentBll(UserName); syncForm = new SyncHhtForm(UserName); syncForm.CallThread(); //syncForm.SetAutoUploadGrid(); } catch (Exception ex) { log.Error(String.Format("Exception : {0}", ex.StackTrace)); } }