示例#1
0
        public override void SetDefaults(DataTable PrimaryTable)
        {
            base.SetDefaults(PrimaryTable);
            //SetDefault(PrimaryTable,"delete_flagcompeconomica","N");

            if (PrimaryTable.ExtendedProperties["app_default"] != null)
            {
                Hashtable H = (Hashtable)PrimaryTable.ExtendedProperties["app_default"];
                foreach (string field in new string[] { "idexp", "idreg",
                                                        "description", "doc", "docdate",
                                                        "idman",
                                                        "nphase", "autocode", "autokind", "idpayment", "idchargehandling" })
                {
                    if (H[field] != null)
                    {
                        SetDefault(PrimaryTable, field, H[field]);
                    }
                }
                SetDefault(PrimaryTable, "ymov", GetSys("esercizio").ToString());
                //SetDefault(PrimaryTable, "ycreation", GetSys("esercizio").ToString());
                SetDefault(PrimaryTable, "adate", GetSys("datacontabile"));
                return;
            }
            SetDefault(PrimaryTable, "ymov", GetSys("esercizio").ToString());
            //SetDefault(PrimaryTable, "ycreation", GetSys("esercizio").ToString());
            if (CfgFn.GetNoNullInt32(PrimaryTable.Columns["nphase"].DefaultValue) == 0)
            {
                SetDefault(PrimaryTable, "nphase", 1);
            }
            SetDefault(PrimaryTable, "adate", GetSys("datacontabile"));
        }
示例#2
0
        private bool CalcolaDateDaPeriodo(DataRow RigaAutRiten, out DateTime DataInizio,
                                          out DateTime DataFine)
        {
            int mesiperiodicita = CfgFn.GetNoNullInt32(RigaAutRiten["idexpirationkind"]);

            DataInizio = new DateTime(1, 1, 1);
            DataFine   = new DateTime(1, 1, 1);
            if (12 % mesiperiodicita > 0)
            {
                // periodo non ammesso!
                return(false);
            }
            int annocorrente = esercizio;            //(int)Conn.sys["esercizio"];
            int mesecorrente = ((DateTime)Meta.GetSys("datacontabile")).Month;
            //((DateTime)Conn.sys["datacontabile"]).Month;
            int periodocorrente = CalcolaPeriodo(mesecorrente, mesiperiodicita, RigaAutRiten);

            if (periodocorrente < 1)               // vero se tipoperiodo=P e se il periodo è il primo dell'anno
            // si posiziona sull'ultimo periodo dell'anno precedente
            {
                periodocorrente = 12 / mesiperiodicita;
                annocorrente--;
            }

            int meseinizioperiodo = mesiperiodicita * (periodocorrente - 1) + 1;
            int mesefineperiodo   = mesiperiodicita * periodocorrente;

            DataInizio = new DateTime(annocorrente, 1, 1);
            DataFine   = new DateTime(annocorrente, mesefineperiodo,
                                      DateTime.DaysInMonth(annocorrente, mesefineperiodo));

            return(true);
        }
示例#3
0
        private void impostaCampi(DataRow R, string listingtype)
        {
            if (listingtype != "documentitrasmessi")
            {
                return;
            }
            if (R["autokind"] == DBNull.Value)
            {
                return;
            }
            bool flagunchanged = false;

            if (R.RowState == DataRowState.Unchanged)
            {
                flagunchanged = true;
            }
            if (CfgFn.GetNoNullInt32(R["autokind"]) == 10)
            {
                R["!varkind"] = "Annullamento Parziale";
            }
            if (CfgFn.GetNoNullInt32(R["autokind"]) == 11)
            {
                R["!varkind"] = "Annullamento";
            }
            ;
            if (CfgFn.GetNoNullInt32(R["autokind"]) == 22)
            {
                R["!varkind"] = "Modifica Dati";
            }
            if (flagunchanged)
            {
                R.AcceptChanges();
            }
        }
示例#4
0
        public override bool IsValid(DataRow R, out string errmess, out string errfield)
        {
            if (!base.IsValid(R, out errmess, out errfield))
            {
                return(false);
            }

            if (CfgFn.GetNoNullInt32(R["idsorkind"]) == 0)
            {
                errmess  = "Bisogna specificare il tipo di classificazione";
                errfield = "idsorkind";
                return(false);
            }

            if (CfgFn.GetNoNullInt32(R["idsor"]) == 0)
            {
                errmess  = "Bisogna specificare la voce di classificazione";
                errfield = "idsor";
                return(false);
            }

            if (CfgFn.GetNoNullInt32(R["idclawback"]) == 0)
            {
                errmess  = "Bisogna specificare il recupero";
                errfield = "idclawback";
                return(false);
            }
            return(true);
        }
示例#5
0
        public override void SetDefaults(DataTable PrimaryTable)
        {
            base.SetDefaults(PrimaryTable);
            if ((PrimaryTable.Columns["yservreg"].DefaultValue == DBNull.Value) || (CfgFn.GetNoNullInt32(PrimaryTable.Columns["yservreg"]) == 0))
            {
                SetDefault(PrimaryTable, "yservreg", GetSys("esercizio"));
            }
            if (PrimaryTable.Columns["flaghuman"].DefaultValue == DBNull.Value)
            {
                SetDefault(PrimaryTable, "flaghuman", "N");
            }
            SetDefault(PrimaryTable, "officeduty", "N");
            SetDefault(PrimaryTable, "payment", "N");
            SetDefault(PrimaryTable, "flagforeign", "N");
            SetDefault(PrimaryTable, "conferring_flagforeign", "N");
            SetDefault(PrimaryTable, "is_delivered", "N");
            SetDefault(PrimaryTable, "is_changed", "N");
            SetDefault(PrimaryTable, "is_annulled", "N");
            SetDefault(PrimaryTable, "is_blocked", "N");
            SetDefault(PrimaryTable, "website_annulled", "N");
            SetDefault(PrimaryTable, "regulation", "N");
            SetDefault(PrimaryTable, "rulespecifics", "N");

            string securityServiceagency = Conn.SelectCondition("serviceagency", true);

            DataTable Tserviceagency = Conn.RUN_SELECT("serviceagency", "*", null, securityServiceagency, null, null, false);

            if (Tserviceagency.Rows.Count > 0)
            {
                DataRow Rserviceagency = Tserviceagency.Rows[0];
                SetDefault(PrimaryTable, "pa_code", Rserviceagency["pa_code"].ToString());
                //SetDefault(PrimaryTable, "pa_title", Rserviceagency["pa_title"].ToString());
                //SetDefault(PrimaryTable, "pa_cf", Rserviceagency["pa_cf"].ToString());
            }
        }
示例#6
0
        private void chiusuraEsercizio()
        {
            if (DS.accountingyear.Rows.Count == 0)
            {
                return;
            }
            DataRow rAccountingYear = DS.accountingyear.Rows[0];
            int     flag            = CfgFn.GetNoNullInt32(rAccountingYear["flag"]);

            if ((flag & 32) == 0)
            {
                flag |= 0x20;
            }

            rAccountingYear["flag"] = flag;

            PostData Post = Meta.Get_PostData();

            Post.InitClass(DS, Meta.Conn);
            if (!Post.DO_POST())
            {
                MessageBox.Show(this, "Errore durante la chiusura dell'esercizio" + esercizio);
            }
            else
            {
                MessageBox.Show(this, "Esercizio " + esercizio + " chiuso correttamente");
            }
            this.Close();
        }
示例#7
0
        public override System.Data.DataRow Get_New_Row(System.Data.DataRow ParentRow, System.Data.DataTable T)
        {
            int  flag           = CfgFn.GetNoNullInt32(ParentRow["flag"]);
            bool ispieceacquire = ((flag & 4) != 0);

            if (!ispieceacquire)
            {
                RowChange.MarkAsAutoincrement(T.Columns["idasset"], null, null, 6);
                RowChange.ClearAutoIncrement(T.Columns["idpiece"]);
                RowChange.ClearSelector(T, "idasset");
                SetDefault(T, "idpiece", 1);
            }
            else
            {
                RowChange.MarkAsAutoincrement(T.Columns["idpiece"], null, null, 6);
                RowChange.ClearAutoIncrement(T.Columns["idasset"]);
                RowChange.SetSelector(T, "idasset");
            }
            DataRow R = base.Get_New_Row(ParentRow, T);

            if (ispieceacquire)
            {
                if (R["idpiece"].ToString() == "1")
                {
                    R["idpiece"] = 2;
                }
            }
            return(R);
        }
示例#8
0
        public DataTable GetTableTracciato(string[] tracciato)
        {
            int       pos = 0;
            DataTable T   = new DataTable("t");

            T.Columns.Add("nome", typeof(string));
            T.Columns.Add("posizione", typeof(int));
            T.Columns.Add("lunghezza", typeof(string));
            T.Columns.Add("tipo", typeof(string));
            T.Columns.Add("codifica", typeof(string));
            T.Columns.Add("Descrizione", typeof(string));

            foreach (string t in tracciato)
            {
                DataRow  r  = T.NewRow();
                string[] ss = t.Split(';');
                r["nome"]      = ss[0];
                r["posizione"] = pos;
                r["lunghezza"] = CfgFn.GetNoNullInt32(ss[3]);
                r["tipo"]      = ss[2];
                if (ss.Length == 5)
                {
                    r["codifica"] = ss[4];
                }
                r["Descrizione"] = ss[1];
                pos += CfgFn.GetNoNullInt32(ss[3]);
                T.Rows.Add(r);
            }
            return(T);
        }
示例#9
0
        public void MetaData_AfterLink()
        {
            MetaData   Meta  = MetaData.GetMetaData(this);
            DataAccess Conn  = MetaData.GetConnection(this);
            string     param = Meta.ExtraParameter as string;

            string filter = Meta.QHS.CmpEq("ayear", Meta.GetSys("esercizio"));

            string staticfilter = param;

            GetData.SetStaticFilter(DS.finview, param);

            string oldfilter = GetData.MergeFilters(null, DS.finlevel);

            if (oldfilter != null)
            {
                GetData.SetStaticFilter(DS.finlevel, filter);
            }
            GetData.CacheTable(DS.finlevel);
            GetData.SetSorting(DS.finview, "printingorder");

            int finkind = CfgFn.GetNoNullInt32(Conn.GetSys("fin_kind"));

            if (finkind == 3)
            {
                dataGrid1.Tag = "TreeNavigator.tree2";
            }
        }
示例#10
0
        void RenderHtmlPage(DataAccess DepConn)
        {
            int n_anno = CfgFn.GetNoNullInt32(HelpForm.GetObjectFromString(typeof(int), anno.Text, null));

            if (n_anno == 0)
            {
                n_anno = DateTime.Now.Year;
            }
            string kind = rdbTipo.SelectedValue;

            if (kind == null)
            {
                kind = "C";
            }
            kind = kind.ToUpper();
            if (kind != "D")
            {
                kind = "C";
            }
            DataTable dt = GetMainData(DepConn, n_anno, kind, dep);

            string xml = getHtmlForTable(dt);

            mydata.InnerHtml = xml;
        }
示例#11
0
        public void MetaData_AfterFill()
        {
            DataRow lastRow = HelpForm.GetLastSelected(DS.sortinglevel);
            int     flag    = CfgFn.GetNoNullInt32(lastRow["flag"]);

            txtLungCodice.Text = (flag >> 8).ToString();
        }
示例#12
0
        private void gestisciGruppoPrevisioneSecondaria()
        {
            int finkind = CfgFn.GetNoNullInt32(Meta.GetSys("fin_kind"));

            grpPrevSec.Visible     = (finkind == 3);
            grpPrevSecCons.Visible = (finkind == 3);
        }
示例#13
0
        public override bool DO_POST()
        {
            bool res = base.DO_POST();

            if (res)
            {
                if (dsSource != null)
                {
                    if (dsSource.Tables["expense"].Rows.Count > 0)
                    {
                        DataRow SourceExpense = dsSource.Tables["expense"].Rows[0];
                        int     fasespesafine = Convert.ToInt32(DS.Tables["expense"].ExtendedProperties["fasespesafine"]);
                        DataRow Last          = DS.Tables["expense"].Select("nphase=" + fasespesafine)[0];
                        int     idlastphase   = CfgFn.GetNoNullInt32(Last["idexp"]);
                        SourceExpense["idexp"]  = idlastphase;
                        SourceExpense["nphase"] = fasespesafine;

                        if (dsSource.Tables["expenselast"].Rows.Count > 0)
                        {
                            DataRow SourceExpenseLast = dsSource.Tables["expenselast"].Rows[0];
                            SourceExpenseLast["idexp"] = idlastphase;
                        }


                        if (dsSource.Tables["expenseyear"].Rows.Count > 0)
                        {
                            DataRow SourceExpenseYear = dsSource.Tables["expenseyear"].Rows[0];
                            SourceExpenseYear["idexp"] = idlastphase;
                        }
                    }

                    if (DS.Tables.Contains("payment"))
                    {
                        foreach (DataRow rPayment in DS.Tables["payment"].Rows)
                        {
                            int kpay = CfgFn.GetNoNullInt32(rPayment["kpay"]);
                            if (kpay == 0)
                            {
                                continue;
                            }
                            Conn.CallSP("compute_payment_bank", new object[] { kpay });
                        }
                    }

                    if (DS.Tables.Contains("proceeds"))
                    {
                        foreach (DataRow rProceeds in DS.Tables["proceeds"].Rows)
                        {
                            int kpro = CfgFn.GetNoNullInt32(rProceeds["kpro"]);
                            if (kpro == 0)
                            {
                                continue;
                            }
                            Conn.CallSP("compute_proceeds_bank", new object[] { kpro });
                        }
                    }
                }
            }
            return(res);
        }
示例#14
0
        public override string InitClass(DataSet DS, DataAccess Conn)
        {
            int fasefine     = CfgFn.GetNoNullInt32(DS.Tables["expense"].Rows[0]["nphase"]);
            int fasespesamax = CfgFn.GetNoNullInt32(Conn.GetSys("maxexpensephase"));

            ga = new GestioneAutomatismi(null, Conn, Disp, DS, fasefine, fasespesamax, "expense", false);
            bool res = ga.GeneraAutomatismiAfterPost(true);

            if (!res)
            {
                return("NoSave");
            }
            DataSet DSP = ga.DSP;

            MetaData metaSpesa = Disp.Get("expense");

            metaSpesa.ComputeRowsAs(DSP.Tables["expense"], "posting");

            MetaData metaEntrata = Disp.Get("income");

            metaEntrata.ComputeRowsAs(DSP.Tables["income"], "posting");

            MetaData metaVarSpesa = Disp.Get("expensevar");

            metaVarSpesa.ComputeRowsAs(DSP.Tables["expensevar"], "posting");

            return(base.InitClass(DSP, Conn));
        }
示例#15
0
        public void MetaData_AfterLink()
        {
            bool IsAmministrazione = false;

            Meta               = MetaData.GetMetaData(this);
            Meta.CanSave       = false;
            Meta.CanInsert     = false;
            Meta.CanInsertCopy = false;
            Meta.CanCancel     = false;
            if (Meta.GetSys("userdb") != null)
            {
                IsAmministrazione = (Meta.GetSys("userdb").ToString().ToLower() == "amministrazione");
            }
            txtEsercizio.Text = Meta.GetSys("esercizio").ToString();
            DateTime dtPrimoDelMese = new DateTime(
                CfgFn.GetNoNullInt32(Meta.GetSys("esercizio")),
                ((DateTime)Meta.GetSys("datacontabile")).Month,
                1);

            DateTime dtUltimoDelMesePrec = dtPrimoDelMese.AddDays(-1);

            //txtDataRiferimento.Text = ((DateTime)Meta.GetSys("datacontabile")).ToShortDateString();

            txtDataRiferimento.Text = dtUltimoDelMesePrec.ToShortDateString();
            HelpForm.ExtLeaveDateTimeTextBox(txtDataRiferimento, null);
            btnFillExpensetax.Enabled      = IsAmministrazione;
            btnFillUnifiedClawback.Enabled = IsAmministrazione;
        }
示例#16
0
        public override bool IsValid(DataRow R, out string errmess, out string errfield)
        {
            if (!base.IsValid(R, out errmess, out errfield))
            {
                return(false);
            }

            int codicecreddeb = CfgFn.GetNoNullInt32(R["idreg"]);

            if (codicecreddeb <= 0)
            {
                errmess  = "Inserire l'anagrafica";
                errfield = "idreg";
                return(false);
            }

            decimal quota = CfgFn.GetNoNullDecimal(R["quota"]);

            if (quota <= 0 || quota > 1)
            {
                errmess  = "Quota non valida";
                errfield = "quota";
                return(false);
            }
            return(true);
        }
示例#17
0
 int RichiediCodice()
 {
     try {
         //Richiede al sito della sw&More un incrementale da assegnare al db come iddbcliente
         string XX = "newid";
         while ((XX.Length % 8) != 0)
         {
             XX += " ";
         }
         byte []   B2  = DataAccess.CryptString(XX);
         string    SS2 = QueryCreator.ByteArrayToString(B2);
         WebClient W   = new WebClient();
         W.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
         W.BaseAddress = "http://ticket.temposrl.it/LiveLog/";
         byte[] B    = W.DownloadData("http://ticket.temposrl.it/LiveLog/DoEasy.aspx?a=" + SS2);
         string resp = "";
         for (int i = 0; i < B.Length; i++)
         {
             resp = resp + (char)B[i];
         }
         resp = resp.Trim();
         return(CfgFn.GetNoNullInt32(resp));
     }
     catch {
         return(0);
     }
 }
示例#18
0
        public override DataRow Get_New_Row(DataRow ParentRow, DataTable T)
        {
            string    testoMessaggio = "Bisogna inserire i dati nel form di configurazione della prestazione occasionale";
            DataTable configurazione = T.DataSet.Tables["config"];

            DataRow [] configrow = configurazione.Select(QHC.CmpEq("ayear", GetSys("esercizio")));
            if (configrow.Length == 0)
            {
                MessageBox.Show(testoMessaggio, "Prestazione Occasionale - Dati Mancanti", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(null);
            }
            int    flag_autodocnumbering = CfgFn.GetNoNullInt32(configrow[0]["flag_autodocnumbering"]);
            string kind = ((flag_autodocnumbering & 0x20) == 0) ? "A" : "M";

            if (kind.ToUpper() == "A")
            {
                string reset = configrow[0]["casualcontract_flagrestart"].ToString();
                if (reset.ToUpper() == "S")
                {
                    RowChange.SetSelector(T, "ycon");
                }
                RowChange.MarkAsAutoincrement(T.Columns["ncon"], null, null, 0);
            }
            else
            {
                int nmax = CfgFn.GetNoNullInt32(
                    Conn.DO_READ_VALUE("casualcontract", QHS.CmpEq("ycon", GetSys("esercizio")), "MAX(ncon)")) + 1;
                SetDefault(T, "ncon", nmax);
            }
            return(base.Get_New_Row(ParentRow, T));
        }
示例#19
0
        protected bool CheckPreconditionsForced(DataAccess Source, DataAccess Dest)
        {
            DataTable      S          = Source.RUN_SELECT(table, "*", null, filter, null, false);
            DataTable      D          = Dest.RUN_SELECT(table, "*", null, null, null, false);
            int            nmax       = CfgFn.GetNoNullInt32(Dest.DO_READ_VALUE(table, null, "max(" + key + ")")) + 1;
            StringAppender myAppender = new StringAppender(stringtoappend, maxlen);

            Hashtable    H   = new Hashtable();
            CQueryHelper QHC = new CQueryHelper();

            foreach (DataRow Rs in S.Rows)
            {
                object    newval = myAppender.translate(Rs[code].ToString());
                DataRow[] found  = D.Select(QHC.CmpEq(code, newval));
                if (found.Length == 0)
                {
                    H[Rs[key]]     = nmax++;
                    ToAdd[Rs[key]] = 1;
                    continue;
                }
                MessageBox.Show("La tabella di destinazione " + table + " ha già una o più righe con " +
                                code + " = " + newval.ToString(), "Errore");
                return(false);
            }
            MyTR = new ManualTranslator(H);
            AddPrivateTranslator(code, myAppender);
            DefinesPreTranslator(traslcode, MyTR);
            return(true);
        }
示例#20
0
        public void DisplayMember_Accertamento(string filter)
        {
            if (Meta.IsEmpty)
            {
                return;
            }
            DS.admpay_assessmentview.Clear();
            GetData.MarkToAddBlankRow(DS.admpay_assessmentview);
            GetData.Add_Blank_Row(DS.admpay_assessmentview);
            cmbAccertamento.DataSource = null;

            DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.admpay_assessmentview, null, filter, null, true);// da commentare
            cmbAccertamento.DataSource    = DS.admpay_assessmentview;
            cmbAccertamento.DisplayMember = "!nassessment_description";
            cmbAccertamento.ValueMember   = "nassessment";
            cmbAccertamento.SelectedIndex = -1;
            foreach (DataRow R in DS.admpay_assessmentview.Rows)
            {
                if (CfgFn.GetNoNullInt32(R["nassessment"]) == 0)
                {
                    R["!nassessment_description"] = DBNull.Value;
                }
                else
                {
                    R["!nassessment_description"] = R["nassessment"].ToString() + " - " + R["description"].ToString();
                }
            }
            DS.admpay_assessmentview.AcceptChanges();
        }
示例#21
0
        /// <summary>
        /// True if "selectable" and with "no chidren" or maxlevel==current level
        /// </summary>
        /// <returns></returns>
        override public bool CanSelect()
        {
            if (!row_exists())
            {
                return(false);
            }
            DataRow Lev     = LevelRow();
            int     thislev = CfgFn.GetNoNullInt32(Lev["nlevel"]);

            if (thislev < levelop)
            {
                return(false);
            }
            //int flag = CfgFn.GetNoNullInt32(Lev["flag"]);
            //if ((flag & 2) == 0) return false;
            if (HasAutoChildren())
            {
                return(false);
            }
            QueryHelper QHS = Conn.GetQueryHelper();

            if (Conn.RUN_SELECT_COUNT("finusable", QHS.CmpEq("idfin", this.Row["idfin"]), false) == 0)
            {
                return(false);
            }
            return(true);
        }
示例#22
0
        void FreshLogo()
        {
            if (DS.bookingdetail.Rows[0] == null)
            {
                return;
            }
            DataRow Curr   = DS.bookingdetail.Rows[0];
            int     idlist = CfgFn.GetNoNullInt32(Curr["idlist"]);
            object  image  = HasImage(idlist);

            try
            {
                if (image != DBNull.Value)
                {
                    MemoryStream MS = new MemoryStream((byte[])image);
                    Image        IM = new Bitmap(MS, false);
                    pbox.Image = IM;
                }
                else
                {
                    pbox.Image = null;
                }
            }
            catch
            {
                pbox.Image = null;
            }
        }
示例#23
0
        public void MetaData_AfterLink()
        {
            Meta = MetaData.GetMetaData(this);
            QHS  = Meta.Conn.GetQueryHelper();
            QHC  = new CQueryHelper();

            DataRow   Source       = Meta.SourceRow;
            DataTable TEpaccParent = Source.Table.DataSet.Tables["epacc"];

            if (TEpaccParent == null)
            {
                TEpaccParent = Source.Table.DataSet.Tables["epaccview"];
            }
            DataRow ParEpacc = TEpaccParent.Select(QHC.CmpEq("idepacc", Source["idepacc"]))[0];
            int     nphase   = CfgFn.GetNoNullInt32(ParEpacc["nphase"]);
            string  s_table  = "epacc";

            if (nphase == 1)
            {
                s_table = "epacc1";
            }
            string filterCT = QHS.CmpEq("tablename", s_table);

            GetData.CacheTable(DS.sortingapplicabilityview, filterCT, null, true);

            string filterActive = QHS.DoPar(QHS.AppOr(QHS.NullOrEq("active", 'S'), QHS.CmpEq("active", "")));
            string filterI      = QHS.DoPar(QHS.AppOr(QHS.DoPar(QHS.AppAnd(QHS.NullOrLe("start", Meta.GetSys("esercizio")),
                                                                           QHS.NullOrGe("stop", Meta.GetSys("esercizio")), filterActive, filterCT)), QHS.CmpEq("idsorkind", 0)));

            QueryCreator.SetFilterForInsert(DS.sortingapplicabilityview, filterI);
            cmbTipo.DataSource = DS.sortingapplicabilityview;
        }
示例#24
0
        public override bool IsValid(DataRow R, out string errmess, out string errfield)
        {
            if (!base.IsValid(R, out errmess, out errfield))
            {
                return(false);
            }

            if (R["title"].ToString() == "")
            {
                errmess  = "Il campo 'Nome' è obbligatorio";
                errfield = "title";
                return(false);
            }

            if (R["description"].ToString() == "")
            {
                errmess  = "Il campo 'Descrizione' è obbligatorio";
                errfield = "description";
                return(false);
            }

            if (CfgFn.GetNoNullInt32(R["idstore"]) == 0)
            {
                errmess  = "Specificare un magazzino";
                errfield = "idstore";
                return(false);
            }
            return(true);
        }
示例#25
0
        private bool ControllaConfRitenuta(DataRow RigaAutRiten)
        {
            int flag = CfgFn.GetNoNullInt32(RigaAutRiten["idexpirationkind"]);

            if ((flag & 0x08) != 0)
            {
                if (RigaAutRiten["expiringday"] == DBNull.Value)
                {
                    return(false);
                }
                if (CfgFn.GetNoNullInt32(RigaAutRiten["expiringday"]) < 1)
                {
                    return(false);
                }
            }

            if (RigaAutRiten["idexpirationkind"] == DBNull.Value)
            {
                return(false);
            }
            int mesiperiodicita = CfgFn.GetNoNullInt32(RigaAutRiten["idexpirationkind"]);

            if ((mesiperiodicita < 1) || (mesiperiodicita > 12) || (mesiperiodicita == 5) ||
                (mesiperiodicita == 7) || (mesiperiodicita == 8) || (mesiperiodicita == 9) ||
                (mesiperiodicita == 10) || (mesiperiodicita == 11))
            {
                return(false);
            }

            return(true);
        }
示例#26
0
        public override bool IsValid(DataRow R, out string errmess, out string errfield)
        {
            DataRow rPosition      = R.GetParentRow("position_allowanceruledetail");
            int     minincomeclass = CfgFn.GetNoNullInt32(R["minincomeclass"]);
            int     maxincomeclass = CfgFn.GetNoNullInt32(R["maxincomeclass"]);
            int     max            = CfgFn.GetNoNullInt32(rPosition["maxincomeclass"]);

            if (minincomeclass < 0)
            {
                errmess  = "La classe minima deve essere maggiore o uguale a zero";
                errfield = "minincomeclass";
                return(false);
            }
            if (minincomeclass > maxincomeclass)
            {
                errmess  = "La classe minima deve essere <= della classe massima";
                errfield = "minincomeclass";
                return(false);
            }
            if (maxincomeclass > max)
            {
                errmess  = "Per la qualifica '" + rPosition["description"] + "' la massima classe stipendiale è " + max;
                errfield = "maxincomeclass";
                return(false);
            }
            return(base.IsValid(R, out errmess, out errfield));
        }
示例#27
0
        private void btnCasuale_Click(object sender, EventArgs e)
        {
            object idpccdebitstatus = DBNull.Value;
            string filter           = "";

            if (cmbStatodelDebito.SelectedIndex > 0)
            {
                idpccdebitstatus = cmbStatodelDebito.SelectedValue;
            }
            if (idpccdebitstatus != DBNull.Value)
            {
                int maskorder = CfgFn.GetNoNullInt32(DS.pccdebitstatus.Select(QHC.CmpEq("idpccdebitstatus", idpccdebitstatus))[0]["flag"]);
                filter = "( flagstatus & " + QueryCreator.unquotedstrvalue(maskorder, true) + " <>0 )";
            }

            MetaData MCausali = MetaData.GetMetaData(this, "pccdebitmotive");

            MCausali.FilterLocked = true;
            MCausali.DS           = DS.Clone();

            DataRow Choosen = MCausali.SelectOne("default", filter, "pccdebitmotive", null);

            if (Choosen == null)
            {
                return;
            }
            txtCodiceCasualePcc.Text = Choosen["idpccdebitmotive"].ToString();
            txtCausale.Text          = Choosen["description"].ToString();
        }
示例#28
0
 public override void SetDefaults(DataTable T)
 {
     base.SetDefaults(T);
     SetDefault(T, "active", "S");
     SetDefault(T, "flagforeign", "N");
     SetDefault(T, "start", new DateTime(CfgFn.GetNoNullInt32(GetSys("esercizio")), 1, 1));
 }
示例#29
0
        public static DatiImportati ImportaFile(DataAccess Conn, string fname)
        {
            ImportazioneEsitiBancariUnicredit import = new ImportazioneEsitiBancariUnicredit(Conn);

            string tipo = ImportazioneEsitiBancariUnicredit.detectType(fname);

            if (tipo == null)
            {
                return(null);
            }
            bool res;

            if (tipo == "EF06")
            {
                res = import.parseEF06File(fname);
            }
            else
            {
                res = import.parseEF07File(fname);
            }

            if (!res)
            {
                return(null);
            }

            int esercizio = CfgFn.GetNoNullInt32(Conn.GetSys("esercizio"));

            return(ConvertiFlussoBanca.GetDataFrom(esercizio, import.DS.flussobanca));
        }
示例#30
0
        private void VisualizzaCheckBox()
        {
            int n_chk = 8;

            for (int i = 1; i <= (n_chk - 1); i++)
            {
                CheckBox chk = GetCtrlByName("chkCsaUsability" + n_chk.ToString()) as CheckBox;
                if (chk == null)
                {
                    return;
                }
                chk.Visible = false;
            }

            string    num = ""; int bitposition = 0;
            DataTable tservicecsausability = Meta.Conn.RUN_SELECT("servicecsausability", "*", null, null, null, null, true);

            foreach (DataRow r in tservicecsausability.Rows)
            {
                num         = r["idlabel"].ToString();
                bitposition = CfgFn.GetNoNullInt32(r["bitposition"]);
                string dicitura = r["description"].ToString();

                CheckBox CB = GetCtrlByName("chkCsaUsability" + num) as CheckBox;
                if (CB == null)
                {
                    continue;
                }
                CB.Text    = dicitura;
                CB.Tag     = "servicecsamask.value:" + bitposition.ToString();
                CB.Visible = true;
            }
        }