예제 #1
0
        public void Update(int pIntRow)
        {
            try
            {
                string lStrFrom    = mObjDtRanks.GetValue("Desde", pIntRow).ToString();
                string lStrTo      = mObjDtRanks.GetValue("Hasta", pIntRow).ToString();
                string lStrRowCode = mObjDtRanks.GetValue("Code", pIntRow).ToString();

                string ss = lStrFrom.Substring(4, lStrFrom.Count() - 4);
                if (ValidFields(lStrFrom.Substring(3, lStrFrom.Count() - 3), lStrTo.Substring(3, lStrTo.Count() - 3), true, pIntRow))
                {
                    EarringRanksT lObjEarringRanks = mLstEarRnksT.Where(x => x.Row == pIntRow).FirstOrDefault();
                    if (lObjEarringRanks != null)
                    {
                        lObjEarringRanks.EarringFrom = lStrFrom.Substring(3, lStrFrom.Count() - 3);
                        lObjEarringRanks.EarringTo   = lStrTo.Substring(3, lStrTo.Count() - 3);
                    }
                }

                if (lStrRowCode != "0")
                {
                    EarringRanksT lObjUptadeRank = mObjPermissionFactory.GetPermissionsService().GetEarring(lStrRowCode);
                    lObjUptadeRank.EarringFrom = lStrFrom.Substring(3, lStrFrom.Count() - 3);
                    lObjUptadeRank.EarringTo   = lStrTo.Substring(3, lStrTo.Count() - 3);
                    mObjPermissionFactory.GetEarringRanksService().UpdateRanks(lObjUptadeRank);
                }
            }

            catch (Exception ex)
            {
                LogService.WriteError(ex.Message);
                LogService.WriteError(ex);
            }
        }
예제 #2
0
        private void CancelRowList()
        {
            try
            {
                foreach (var item in mLstDeletedRows)
                {
                    EarringRanksT lObjEarringRanksT = new EarringRanksT();

                    lObjEarringRanksT.RowCode     = item.RowCode;
                    lObjEarringRanksT.EarringFrom = item.EarringFrom;
                    lObjEarringRanksT.EarringTo   = item.EarringTo;
                    lObjEarringRanksT.Prefix      = item.Prefix;
                    lObjEarringRanksT.BaseEntry   = item.BaseEntry;
                    lObjEarringRanksT.Cancelled   = "Y";

                    int lIntResult = mObjPermissionFactory.GetEarringRanksService().UpdateRanks(lObjEarringRanksT);
                    if (lIntResult != 0)
                    {
                        string lStrError = DIApplication.Company.GetLastErrorDescription();
                        Application.SBO_Application.StatusBar.SetText(lStrError
                                                                      , SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    }
                }
            }
            catch
            {
            }
        }
예제 #3
0
        public void AddRow()
        {
            string lStrFrom = lStrETActivePrefix + mObjtxtFrom.Value;

            string lStrTo = string.Empty;

            if (!string.IsNullOrEmpty(mObjtxtTo.Value))
            {
                lStrTo = lStrETActivePrefix + mObjtxtTo.Value;
            }
            int lastrow = 0;

            if (ValidFields(mObjtxtFrom.Value, mObjtxtTo.Value, false, 0))
            {
                mObjEarringRanksT = new EarringRanksT();

                mObjDtRanks.Rows.Add();
                lastrow = mObjDtRanks.Rows.Count - 1;
                mObjDtRanks.Columns.Item("Desde").Cells.Item(lastrow).Value = lStrFrom;
                mObjDtRanks.Columns.Item("Hasta").Cells.Item(lastrow).Value = lStrTo;


                mObjEarringRanksT.EarringFrom = mObjtxtFrom.Value;
                mObjEarringRanksT.EarringTo   = mObjtxtTo.Value;
                mObjEarringRanksT.Prefix      = lStrETActivePrefix;
                mObjEarringRanksT.Row         = lastrow;
                mLstEarRnksT.Add(mObjEarringRanksT);
                ClearFields();
            }
        }
예제 #4
0
        public EarringRanksT GetEarringRank(string lStrRowCode)
        {
            EarringRanksT lObjEarring = new EarringRanksT();

            lObjEarring = mObjQueryManager.GetObjectsList <EarringRanksT>("Code", lStrRowCode, "[@UG_PE_ERNK]").FirstOrDefault();

            return(lObjEarring);
        }
예제 #5
0
        internal void CancelRow()
        {
            var lVarSelRows = mObjRanksGrid.Rows.SelectedRows;

            if (lVarSelRows.Count > 0)
            {
                int lIntSelRow = lVarSelRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder);

                string lStrEarringFrom = mObjRanksGrid.DataTable.Columns.Item("Desde").Cells.Item(lIntSelRow).Value.ToString().Substring(3);
                string lStrEarringTo   = mObjRanksGrid.DataTable.Columns.Item("Hasta").Cells.Item(lIntSelRow).Value.ToString();

                if (!string.IsNullOrEmpty(lStrEarringTo))
                {
                    lStrEarringTo = mObjRanksGrid.DataTable.Columns.Item("Hasta").Cells.Item(lIntSelRow).Value.ToString().Substring(3);
                }
                else
                {
                    lStrEarringTo = lStrEarringFrom;
                }

                int lIntRowCode = Convert.ToInt32(mObjRanksGrid.DataTable.Columns.Item("Code").Cells.Item(lIntSelRow).Value);
                if (lIntSelRow >= 0)
                {
                    if (Convert.ToInt32(mObjRanksGrid.DataTable.Columns.Item("Code").Cells.Item(lIntSelRow).Value) != 0)
                    {
                        //lLstRowCodes.Add(lIntRowCode);

                        mObjEarringRanksT             = new EarringRanksT();
                        mObjEarringRanksT.RowCode     = lIntRowCode.ToString();
                        mObjEarringRanksT.EarringFrom = lStrEarringFrom;
                        mObjEarringRanksT.EarringTo   = lStrEarringTo;
                        mObjEarringRanksT.BaseEntry   = mStrBaseEntry;
                        mObjEarringRanksT.Prefix      = lStrETActivePrefix;

                        mLstDeletedRows.Add(mObjEarringRanksT);

                        mObjRanksGrid.DataTable.Rows.Remove(lIntSelRow);
                    }
                    else
                    {
                        var lVarTempLst = mLstEarRnksT.Single(x => x.RowCode == null && x.EarringFrom == lStrEarringFrom && x.EarringTo == lStrEarringTo);
                        mLstEarRnksT.Remove(lVarTempLst);

                        mObjRanksGrid.DataTable.Rows.Remove(lIntSelRow);
                    }

                    mObjtxtTotal.Value = GetTotal().ToString();
                    // increaseHeadCounter(lStrEarringFrom.Substring(1), lStrEarringTo.Substring(1));
                }
            }
            else
            {
                Application.SBO_Application.StatusBar.SetText("Seleccionar una línea"
                                                              , SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
        }
예제 #6
0
        public void AddRow()
        {
            string lStrFrom = lObjETActivePrefix.Value + lObjETxtFrom.Value;
            string lStrTo   = lObjETActivePrefix.Value + lObjETxtTo.Value;
            int    lastrow  = 0;

            if (ValidFields())
            {
                lObjEarringRanksT = new EarringRanksT();

                lObjDtRanks.Rows.Add();
                lastrow = lObjDtRanks.Rows.Count - 1;
                lObjDtRanks.Columns.Item("Desde").Cells.Item(lastrow).Value = lStrFrom;
                lObjDtRanks.Columns.Item("Hasta").Cells.Item(lastrow).Value = lStrTo;

                lObjEarringRanksT.EarringFrom = lObjETxtFrom.Value;
                lObjEarringRanksT.EarringTo   = lObjETxtTo.Value;
                lObjEarringRanksT.Prefix      = lObjETActivePrefix.Value;

                lLstEarRnksT.Add(lObjEarringRanksT);

                ClearFields();
            }
        }
예제 #7
0
 public int UpdateRanks(EarringRanksT pObjCert)
 {
     return(mObjEarringRanksDAO.Update(pObjCert));
 }
예제 #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pObjInsp"></param>
        /// <returns></returns>
        public int SaveRanks(EarringRanksT pObjCert)
        {
            int result = mObjEarringRanksDAO.Add(pObjCert);

            return(result);
        }