예제 #1
0
        /// <summary>
        /// Open the detailed information for an item when the user double clicks on the grid.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridItemsChoice_DoubleClick(object sender, EventArgs e)
        {
            DataRow dr = gridItemChoiceView.GetFocusedDataRow();

            if (dr == null)
            {
                return;
            }

            int itemId = Convert.ToInt32(dr["ID"]);

            dtDate.Value        = DateTime.Now;
            dtDate.CustomFormat = "MM/dd/yyyy";
            _dtCur = ConvertDate.DateConverter(dtDate.Text);

            int month = _dtCur.Month;
            //int year = (month < 11) ? Convert.ToInt32(cboYear.EditValue) : Convert.ToInt32(cboYear.EditValue);
            int year = Convert.ToInt32(cboYear.EditValue);

            EthiopianDate.EthiopianDate ethioDate = new EthiopianDate.EthiopianDate(year, month, 30);

            //ItemDetailReport con = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.EditValue), year, 0);
            ItemDetailReport con = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.EditValue), year, 0);//ethioDate.FiscalYear

            con.ShowDialog();
        }
예제 #2
0
        private void lstItem_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (lstItem.SelectedItems[0].Tag != null)
            {
                int month = dtCurrent.Month;
                int year  = Convert.ToInt32(cboYear.SelectedItem);

                int itemId           = Convert.ToInt32(lstItem.SelectedItems[0].Tag);
                ItemDetailReport con = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.SelectedValue), year, 8);
                con.ShowDialog();
            }
        }
예제 #3
0
파일: SOHTrend.cs 프로젝트: HCMISFE/FE
        private void lstItem_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (lstItem.SelectedItems[0].Tag != null)
            {
                dtDate.Value        = DateTime.Now;
                dtDate.CustomFormat = "MM/dd/yyyy";
                DateTime dtCur = ConvertDate.DateConverter(dtDate.Text);
                int      month = dtCur.Month;
                int      year  = (cboYear.SelectedItem != null) ? Convert.ToInt32(cboYear.SelectedItem) : dtCur.Year;

                int itemId           = Convert.ToInt32(lstItem.SelectedItems[0].Tag);
                ItemDetailReport con = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.SelectedValue), year, 2);
                con.ShowDialog();
            }
        }
예제 #4
0
        /// <summary>
        /// Opens the detailed item report for the chosen item
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridItemListView_DoubleClick(object sender, EventArgs e)
        {
            var     view = sender as GridView;
            DataRow dr   = view.GetFocusedDataRow();

            if (view != null && VisibilitySetting.HandleUnits == 1)
            {
                if (dr != null)
                {
                    dtDate.Value        = DateTime.Now;
                    dtDate.CustomFormat = "MM/dd/yyyy";
                    DateTime dtCur  = ConvertDate.DateConverter(dtDate.Text);
                    var      month  = dtCur.Month;
                    var      year   = (month < 11) ? dtCur.Year : dtCur.Year + 1;
                    var      itemId = Convert.ToInt32(dr["ID"]);
                    var      con    = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.SelectedValue), year, 0);
                    con.ShowDialog();
                }
            }
            else if (view != null && VisibilitySetting.HandleUnits == 2)
            {
                if (dr != null)
                {
                    dtDate.Value        = DateTime.Now;
                    dtDate.CustomFormat = "MM/dd/yyyy";
                    DateTime dtCur  = ConvertDate.DateConverter(dtDate.Text);
                    var      month  = dtCur.Month;
                    var      year   = (month < 11) ? dtCur.Year : dtCur.Year + 1;
                    var      itemId = Convert.ToInt32(dr["ID"]);
                    var      con    = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.SelectedValue), year, 0, Convert.ToInt32(dr["ID"]));
                    con.ShowDialog();
                }
            }
            else if (view != null && VisibilitySetting.HandleUnits == 3)
            {
                if (dr != null)
                {
                    dtDate.Value        = DateTime.Now;
                    dtDate.CustomFormat = "MM/dd/yyyy";
                    DateTime dtCur  = ConvertDate.DateConverter(dtDate.Text);
                    var      month  = dtCur.Month;
                    var      year   = (month < 11) ? dtCur.Year : dtCur.Year + 1;
                    var      itemId = Convert.ToInt32(dr["ID"]);
                    var      con    = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.SelectedValue), year, 0, Convert.ToInt32(dr["ID"]));
                    con.ShowDialog();
                }
            }
        }
예제 #5
0
        /// <summary>
        /// Open the detailed information for an item when the user double clicks on the grid.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridItemsChoice_DoubleClick(object sender, EventArgs e)
        {
            DataRow dr = gridItemChoiceView.GetFocusedDataRow();

            if (dr == null)
            {
                return;
            }
            int itemId = Convert.ToInt32(dr["ID"]);

            dtDate.Value        = DateTime.Now;
            dtDate.CustomFormat = "MM/dd/yyyy";
            _dtCur = ConvertDate.DateConverter(dtDate.Text);

            int month = Convert.ToInt32(cboMonth.EditValue);
            //int year = (month < 11) ? Convert.ToInt32(cboYear.EditValue) : Convert.ToInt32(cboYear.EditValue);
            int year      = Convert.ToInt32(cboYear.EditValue);
            var ethioDate = new EthiopianDate.EthiopianDate(year, month, 30);

            switch (VisibilitySetting.HandleUnits)
            {
            case 2:
            {
                unitID = Convert.ToInt32(dr["UnitID"]);
                var con1 = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.EditValue), year, 0, unitID);        //ethioDate.FiscalYear
                con1.ShowDialog();
            }
            break;

            case 3:
            {
                unitID = Convert.ToInt32(dr["UnitID"]);
                var con1 = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.EditValue), year, 0, unitID);        //ethioDate.FiscalYear
                con1.ShowDialog();
            }
            break;

            default:
            {
                //ItemDetailReport con = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.EditValue), year, 0);
                ItemDetailReport con = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.EditValue), year, 0);
                //ethioDate.FiscalYear
                con.ShowDialog();
            }
            break;
            }
        }
예제 #6
0
        private void detailToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GridView view = sender as GridView;
            DataRow  dr   = view.GetFocusedDataRow();

            if (dr != null)
            {
                dtRecDate.Value        = DateTime.Now;
                dtRecDate.CustomFormat = "MM/dd/yyyy";
                DateTime dtCur = ConvertDate.DateConverter(dtRecDate.Text);
                int      year  = ((dtCur.Month < 11) ? dtCur.Year : dtCur.Year + 1);
                dtRecDate.CustomFormat = "MMM dd,yyyy";
                int itemId           = Convert.ToInt32(dr["ID"]);
                ItemDetailReport con = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.EditValue), year, 0);
                con.ShowDialog();
            }
        }
예제 #7
0
        private void detailToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var dr = grdLogIssue.GetFocusedDataRow();

            if (dr == null)
            {
                return;
            }

            int tranId = Convert.ToInt32(dr["ID"]);

            var dtDate = new CalendarLib.DateTimePickerEx
            {
                Value        = DateTime.Now,
                CustomFormat = "MM/dd/yyyy"
            };
            DateTime dtCur  = ConvertDate.DateConverter(dtDate.Text);
            int      itemId = Convert.ToInt32(dr["ItemID"]);
            int      yr     = ((dtCur.Month < 11) ? dtCur.Year : dtCur.Year + 1);

            switch (VisibilitySetting.HandleUnits)
            {
            case 1:
            {
                var con = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.EditValue), yr, 0);
                con.ShowDialog();
            }
            break;

            case 2:
            {
                int unitId = Convert.ToInt32(dr["UnitID"]);
                var con    = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.EditValue), yr, 0, unitId);
                con.ShowDialog();
            }
            break;

            case 3:
            {
                int unitId = Convert.ToInt32(dr["UnitID"]);
                var con    = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.EditValue), yr, 0, unitId);
                con.ShowDialog();
            }
            break;
            }
        }
 private void detailItemStatusToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!BLL.Settings.UseNewUserManagement ||
         (BLL.Settings.UseNewUserManagement && this.HasPermission("View-Item-Detail")))
     {
         DataRow dr = gridViewTransaction.GetFocusedDataRow();
         if (dr != null)
         {
             int?unitID = null;
             if (dr["UnitID"] != DBNull.Value)
             {
                 unitID = Convert.ToInt32(dr["UnitID"]);
             }
             ItemDetailReport con = new ItemDetailReport(Convert.ToInt32(dr["ItemID"]), unitID,
                                                         Convert.ToInt32(dr["StoreID"]), 0);
             con.ShowDialog();
         }
     }
 }
예제 #9
0
파일: BalanceReport.cs 프로젝트: HCMISFE/FE
        /// <summary>
        /// Opens the detailed item report for the chosen item
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridItemListView_DoubleClick(object sender, EventArgs e)
        {
            GridView view = sender as GridView;

            if (view != null)
            {
                DataRow dr = view.GetFocusedDataRow();
                if (dr != null)
                {
                    dtDate.Value        = DateTime.Now;
                    dtDate.CustomFormat = "MM/dd/yyyy";
                    DateTime         dtCur  = ConvertDate.DateConverter(dtDate.Text);
                    int              month  = dtCur.Month;
                    int              year   = (month < 11) ? dtCur.Year : dtCur.Year + 1;
                    int              itemId = Convert.ToInt32(dr["ID"]);
                    ItemDetailReport con    = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.SelectedValue), year, 0);
                    con.ShowDialog();
                }
            }
        }
예제 #10
0
        private void lstItem_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (lstItem.SelectedItems[0].Tag != null)
            {
                dtDate.Value        = DateTime.Now;
                dtDate.CustomFormat = "MM/dd/yyyy";
                DateTime dtCur = new DateTime();// Convert.ToDateTime(dtDate.Text);
                try
                {
                    dtCur = Convert.ToDateTime(dtDate.Text);
                }
                catch
                {
                    string dtValid = "";
                    string yer     = "";
                    if (Convert.ToInt32(dtDate.Text.Substring(0, 2)) == 13)
                    {
                        dtValid = dtDate.Text;
                        yer     = dtValid.Substring(dtValid.Length - 4, 4);
                        dtCur   = Convert.ToDateTime("12/30/" + yer);
                    }
                    else if (Convert.ToInt32(dtDate.Text.Substring(0, 2)) == 2)
                    {
                        dtValid = dtDate.Text;
                        yer     = dtValid.Substring(dtValid.Length - 4, 4);
                        dtCur   = Convert.ToDateTime("2/28/" + yer);
                    }
                }
                int month = Convert.ToInt32(cboMonth.SelectedValue);
                int year  = (month < 11) ? dtCur.Year : dtCur.Year - 1;

                int itemId           = Convert.ToInt32(lstItem.SelectedItems[0].Tag);
                ItemDetailReport con = new ItemDetailReport(itemId, Convert.ToInt32(cboStores.SelectedValue), year, 0);
                con.ShowDialog();
            }
        }