Пример #1
0
        public void MetaData_AfterRowSelect(DataTable T, DataRow R)
        {
            if (Meta.IsEmpty)
            {
                return;
            }
            if (T.TableName == "incomelastview")
            {
                if (R == null)
                {
                    return;
                }
                Meta.GetFormData(true);
                foreach (DataRow DD in DS.incomelastview.Select())
                {
                    if (DD["nmov"].ToString() == R["nmov"].ToString())
                    {
                        continue;
                    }
                    if (DD["kpro", DataRowVersion.Original] == DBNull.Value)
                    {
                        DD.Delete();
                        DD.AcceptChanges();
                        continue;
                    }
                    if (DD["nmov"].ToString() != R["nmov"].ToString())
                    {
                        DD["kpro"] = DBNull.Value;
                    }
                }
                DataRow DocIncasso = DS.proceeds.Rows[0];
                //if (flagresidui) DocIncasso["kind"]=R["flagarrear"].ToString();
                if (flagresidui)
                {
                    string flagarrear = R["flagarrear"].ToString().ToUpper();
                    int    flag       = CfgFn.GetNoNullInt32(DocIncasso["flag"]);
                    flag = flag & 0xF8;
                    if (flagarrear == "C")
                    {
                        flag = flag + 1;
                        DocIncasso["flag"] = flag; //C
                    }
                    else
                    {
                        flag = flag + 2;
                        DocIncasso["flag"] = flag; //R
                    }
                }
                if (flagcreddeb)
                {
                    DocIncasso["idreg"] = R["idreg"];
                }
                if (flagbilancio)
                {
                    DocIncasso["idfin"] = calcolaBilancioPerReversale(R["idfin"]);
                }
                if (flagrespons)
                {
                    DocIncasso["idman"] = R["idman"];
                }
                Meta.FreshForm(false);
            }
            if (T.TableName == "treasurer" && R != null)
            {
                DataRow RInc = DS.proceeds.Rows[0];
                int     flag = CfgFn.GetNoNullInt32(RInc["flag"]);

                if (R["flagfruitful"].ToString().ToUpper() == "F")
                {
                    rdbInfruttifero.Checked = false;
                    rdbFruttifero.Checked   = true;
                    flag = flag | 8;
                }
                else
                {
                    rdbFruttifero.Checked   = false;
                    rdbInfruttifero.Checked = true;
                    flag = flag & 0xF7;
                }
                RInc["flag"] = flag;
            }
        }
Пример #2
0
 public void MetaData_AfterRowSelect(DataTable T, DataRow R)
 {
     if (Meta.IsEmpty)
     {
         return;
     }
     if (T.TableName == "expenselastview")
     {
         if (R == null)
         {
             return;
         }
         if (!Meta.DrawStateIsDone)
         {
             return;
         }
         Meta.GetFormData(true);
         foreach (DataRow DD in DS.expenselastview.Select())
         {
             if (DD["nmov"].ToString() == R["nmov"].ToString())
             {
                 continue;
             }
             if (DD["kpay", DataRowVersion.Original] == DBNull.Value)
             {
                 DD.Delete();
                 DD.AcceptChanges();
                 continue;
             }
             if (DD["nmov"].ToString() != R["nmov"].ToString())
             {
                 DD["kpay"] = DBNull.Value;
             }
         }
         DataRow DocPagamento = DS.payment.Rows[0];
         if (flagresidui)
         {
             string flagarrear = R["flagarrear"].ToString().ToUpper();
             int    flag       = CfgFn.GetNoNullInt32(DS.payment.Columns["flag"].DefaultValue);
             flag = flag & 0xF8;
             if (flagarrear == "C")
             {
                 flag = flag + 1;
                 DocPagamento["flag"] = flag; //C
             }
             else
             {
                 flag = flag + 2;
                 DocPagamento["flag"] = flag; //R
             }
         }
         if (flagcreddeb)
         {
             DocPagamento["idreg"] = R["idreg"];
         }
         if (flagbilancio)
         {
             DocPagamento["idfin"] = calcolaBilancioPerMandato(R["idfin"]);
         }
         if (flagrespons)
         {
             DocPagamento["idman"] = R["idman"];
         }
         Meta.FreshForm(false);
     }
 }