상속: MonoBehaviour
예제 #1
0
    void Start()
    {
        for (int i = 1; i < level; i++)
        {
            sco += i * 100;
        }

        bb = new GUIStyle();
        bb.normal.background = null;               //这是设置背景填充的
        bb.normal.textColor  = new Color(1, 0, 0); //设置字体颜色的
        bb.fontSize          = 50;                 //当然,这是字体颜色

        aa = new GUIStyle();
        aa.normal.background = null;               //这是设置背景填充的
        aa.normal.textColor  = new Color(1, 0, 0); //设置字体颜色的
        aa.fontSize          = 30;                 //当然,这是字体颜色


        level1.Initial();
        InitBgSrc();                                  //动态加载物体
        GameObject heroobj = GameObject.Find("hero"); //调用脚本background中的地图

        heroscript = (hero)heroobj.GetComponent(typeof(hero));

        GameObject moneyobj = GameObject.Find("enemy");          //调用脚本background中的地图

        moneyscript = (money)moneyobj.GetComponent(typeof(money));

        GameObject startspt = GameObject.Find("startbtn");          //调用脚本background中的地图

        stspt = (startscript)startspt.GetComponent(typeof(startscript));
    }
예제 #2
0
        public ActionResult Index()
        {
            money  db  = new money();
            Random rnd = new Random();//亂數種子
            //for (int i = 0; i < 1000; i++)
            //{
            //    pegeData.number = rnd.Next(0, 100);
            //}
            var listmoney = new List <MyClass>();
            var type      = "";

            foreach (var i in db.AccountBook)
            {
                if (i.Categoryyy == 0)
                {
                    type = "支出";
                }
                else
                {
                    type = "收入";
                }

                listmoney.Add(new MyClass
                {
                    ID      = i.Id.ToString(),
                    CLASS11 = type,
                    DT      = i.Dateee,
                    MONEY   = i.Amounttt,
                    ABOUT   = i.Remarkkk
                });
            }
            return(View(listmoney));
        }
예제 #3
0
파일: hero.cs 프로젝트: weirwood/maze-storm
	// Use this for initialization
	void Start () {
		GameObject backgd = GameObject.Find ("background"); //调用脚本background中的地图
		bg = (background)backgd.GetComponent (typeof(background));

		GameObject moneyobj = GameObject.Find ("enemy"); //调用脚本background中的地图
		moneyscript = (money)moneyobj.GetComponent (typeof(money));
	}
예제 #4
0
	void Start () {
		for (int i =1; i< level; i++) {
			sco+=i*100;
		}

		bb = new GUIStyle();
		bb.normal.background = null;    //这是设置背景填充的
		bb.normal.textColor=new Color(1,0,0);   //设置字体颜色的
		bb.fontSize = 50;       //当然,这是字体颜色

		aa = new GUIStyle();
		aa.normal.background = null;    //这是设置背景填充的
		aa.normal.textColor=new Color(1,0,0);   //设置字体颜色的
		aa.fontSize = 30;       //当然,这是字体颜色


		level1.Initial ();
		InitBgSrc();//动态加载物体
		GameObject heroobj = GameObject.Find ("hero"); //调用脚本background中的地图
		heroscript = (hero)heroobj.GetComponent (typeof(hero));

		GameObject moneyobj = GameObject.Find ("enemy"); //调用脚本background中的地图
		moneyscript = (money)moneyobj.GetComponent (typeof(money));

		GameObject startspt = GameObject.Find ("startbtn"); //调用脚本background中的地图
		stspt = (startscript)startspt.GetComponent (typeof(startscript));
	}
예제 #5
0
 // Use this for initialization
 void Start()
 {
     theGame         = this;
     h               = GameObject.Find("Slider").GetComponent <Healthbar>();
     m               = GameObject.Find("MoneyText").GetComponent <money>();
     endText         = GameObject.FindGameObjectWithTag("GameOverText").GetComponent <Text>();
     endText.enabled = false;
 }
        // GET: money/Details/5
        public ActionResult Details()
        {
            var moneyer = new money {
                moneycounter = 10
            };

            return(View(moneyer));
        }
예제 #7
0
    IEnumerator LateStart(float second)
    {
        yield return(new WaitForSeconds(second));

        playerHealth  = GameObject.FindGameObjectWithTag("Player").GetComponent <Enemy>();
        Money         = playerHealth.gameObject.GetComponent <money>();
        DoneLateStart = true;
    }
예제 #8
0
        public ActionResult XiuGaiHuoDong(action info)
        {
            ActionManager a  = new ActionManager();
            action        an = a.GetByPK(info.actionId);

            an.actionhead      = info.actionhead;
            an.actionresult    = info.actionresult;
            an.actiontime      = info.actiontime;
            an.actionfactmoney = info.actionfactmoney;


            if (info.actionfactmoney > info.actionneedmoney)
            {
                return(Content("<script>alert('实际金额,不能大于所需经费!');window.location = '/ZhengLiang/ FinanceHT /XiuGaiHuoDong';</script>"));
            }
            else
            {
                if (info.actionfactmoney == info.actionneedmoney)
                {
                    var qq = a.Update(an);
                    if (qq)
                    {
                        return(Redirect("~/ZhengLiang/FinanceHT/HuoDongJiLu"));
                    }
                    else
                    {
                        return(Content("<script>alert('修改失败');window.location = '/ZhengLiang/ FinanceHT /HuoDongJiLu';</script>"));
                    }
                }
                else
                {
                    var qq = a.Update(an);
                    if (qq)
                    {
                        //查询出总经费
                        MoneyManager am  = new MoneyManager();
                        money        mys = am.GetByPK(1);
                        mys.overmoney = mys.overmoney + (info.actionneedmoney - info.actionfactmoney);
                        mys.openmoney = mys.openmoney - (info.actionneedmoney - info.actionfactmoney);

                        //修改总经费
                        bool pp = am.Update(mys);
                        if (pp)
                        {
                            return(Redirect("~/ZhengLiang/FinanceHT/HuoDongJiLu"));
                        }
                        else
                        {
                            return(Content("<script>alert('异常!');window.location = '/ZhengLiang/ FinanceHT /HuoDongJiLu';</script>"));
                        }
                    }
                    else
                    {
                        return(Content("<script>alert('修改失败');window.location = '/ZhengLiang/ FinanceHT /HuoDongJiLu';</script>"));
                    }
                }
            }
        }
예제 #9
0
        public void interact(ref userInteraction UI, string fileName)
        {
            //input from a text file

            //string fileName = "UI_interact.txt";
            string[] separators = new string[1];
            separators[0] = ", ";

            using (StreamReader sr = new StreamReader(fileName))
            {
                //read items from file
                string[] el = sr.ReadLine().Split(separators, StringSplitOptions.None); // StringSplitOptions.None will leave the indexes ok if some data is missing from the file
                //el[0] = title of item fields: id
                //el[1] = item1
                //el[2] = item2, etc

                //add items to requested list
                for (int i = 1; i < el.Length; i++)
                {
                    string[] elements = el[i].Split('\t');

                    string id = elements[0];

                    item z = new item();
                    z.id       = Convert.ToInt32(id);
                    z.quantity = 1; // he can take only one fron an id (if he wants two of the same type, the user makes another interaction)

                    //we do not fill properties from vending machine! because the user may not know all of them (we just fill property ID - simulating the press of a button)

                    UI.UI_itemsRequested.Add(z);
                }

                //read money from file
                el = sr.ReadLine().Split(separators, StringSplitOptions.None); // StringSplitOptions.None will leave the indexes ok if some data is missing from the file
                //el[0] = title of money fields: value	quantity
                //el[1] = money1
                //el[2] = money2, etc

                //add money to list
                for (int i = 1; i < el.Length; i++)
                {
                    string[] elements = el[i].Split('\t');

                    string value    = elements[0];
                    string quantity = elements[1];

                    money z = new money();
                    z.value    = Convert.ToInt32(value);
                    z.quantity = Convert.ToInt32(quantity);

                    UI.UI_moneyUsed.Add(z);
                }

                sr.Close();
            }
        }
예제 #10
0
파일: hero.cs 프로젝트: weirwood/maze-storm
    // Use this for initialization
    void Start()
    {
        GameObject backgd = GameObject.Find("background");          //调用脚本background中的地图

        bg = (background)backgd.GetComponent(typeof(background));

        GameObject moneyobj = GameObject.Find("enemy");          //调用脚本background中的地图

        moneyscript = (money)moneyobj.GetComponent(typeof(money));
    }
예제 #11
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         money PlayerWallet = other.GetComponent <money>();
         PlayerWallet.CollectMoney(HowManyMoneyGetWhenContact);
         Destroy(this.gameObject);
         //transform.position = Vector2.Lerp(transform.position, other.transform.position, Time.deltaTime * 10f);
     }
 }
예제 #12
0
        public ActionResult XiaoFeiAdd(consume info)
        {
            //查询出总经费
            MoneyManager aa  = new MoneyManager();
            money        mys = aa.GetByPK(1);

            if (info.consume_money <= mys.overmoney)
            {
                ConsumeManager a  = new ConsumeManager();
                var            qq = a.Add(info);
                if (qq)
                {
                    if (mys.overmoney == null)
                    {
                        mys.overmoney = 0;
                    }
                    if (mys.openmoney == null)
                    {
                        mys.openmoney = 0;
                    }
                    //修改总经费
                    money my = new money();
                    if (my.overmoney == null)
                    {
                        my.overmoney = 0;
                    }
                    if (my.openmoney == null)
                    {
                        my.openmoney = 0;
                    }
                    my.sunId     = 1;
                    my.overmoney = (mys.overmoney - info.consume_money);
                    my.openmoney = (mys.openmoney + info.consume_money);
                    MoneyManager aq  = new MoneyManager();
                    var          boo = aq.Update(my);
                    if (boo)
                    {
                        return(Redirect("~/ZhengLiang/FinanceHT/XiaoFeiAdd"));
                    }

                    else
                    {
                        return(Redirect("~/ZhengLiang/FinanceHT/XiaoFeiAdd"));
                    }
                }
                else
                {
                    return(Content("<script>alert('添加失败')</script>"));
                }
            }
            else
            {
                return(Content("<script>alert('余额不足');window.location = '/ZhengLiang/FinanceHT/XiaoFeiAdd';</script>"));
            }
        }
예제 #13
0
    public void GetDeathStats()
    {
        money PlayerStat = FindObjectOfType <money>();

        totalDamageDealt.text = "Total Damage Dealt: " + PlayerStat.TotalDamageDealt.ToString();
        totalDamageTaken.text = "Total Damage Taken: " + PlayerStat.totalDamageTaken.ToString();
        kills.text            = "Kills: " + PlayerStat.TotalEnemyDie.ToString();
        // rocketKill.text = PlayerStat.TotalEnemyDieRocket.ToString();
        // suicidekill.text = PlayerStat.TotalEnemyDieSuicide.ToString();
        // burstKill.text = PlayerStat.TotalEnemyDieBurst.ToString();
        // shotKill.text = PlayerStat.TotalEnemyDieShotGun.ToString();
    }
예제 #14
0
        //修改活动是否批准
        public ActionResult HuoDongUpdate(int id)
        {
            //查询出总经费
            MoneyManager a   = new MoneyManager();
            money        mys = a.GetByPK(1);
            //根据id,找到这个对象
            ActionManager ss = new ActionManager();
            action        an = ss.GetByPK(id);

            if (an.actiontype == "通过")
            {
                return(Content("<script>alert('该活动以通过!');window.location = '/ZhengLiang/FinanceHT/HuoDongJiLu';</script>"));
            }
            else
            {
                if (mys.overmoney >= an.actionneedmoney)
                {
                    ActionManager aa   = new ActionManager();
                    var           info = aa.GetByPK(id);
                    info.actiontype = "通过";
                    var qq = aa.Update(info);
                    if (qq)
                    {
                        //通过后,财务就支出费用
                        mys.overmoney = mys.overmoney - an.actionneedmoney;
                        mys.openmoney = mys.openmoney + an.actionneedmoney;

                        MoneyManager z  = new MoneyManager();
                        var          my = a.Update(mys);
                        if (my)
                        {
                            return(Redirect("~/ZhengLiang/FinanceHT/HuoDongJiLu"));
                        }
                        else
                        {
                            return(Content("<script>alert('异常');window.location = '/ZhengLiang/ FinanceHT /HuoDongJiLu';</script>"));
                        }
                    }
                    else
                    {
                        return(Content("<script>alert('失败');window.location = '/ZhengLiang/ FinanceHT /HuoDongJiLu';</script>"));
                    }
                }
                else
                {
                    return(Content("<script>alert('余额不足,不能通过');window.location = '/ZhengLiang/ FinanceHT /HuoDongJiLu';</script>"));
                }
            }
        }
예제 #15
0
    private void OnTriggerEnter2D(Collider2D collider)
    {
        bullet bullet = collider.gameObject.GetComponent <bullet>();
        Unit   unit   = collider.gameObject.GetComponent <Unit>();

        if (bullet && bullet.Parent != gameObject)
        {
            Damage();
        }
        money hp = collider.gameObject.GetComponent <money>();

        if (hp && Lives <= 4)
        {
            lives++; Lives++;
        }                                         //восстановление хп
    }
예제 #16
0
 public PizzaOven()
 {
     Ingredients    = new Dictionary <System.Type, Consumable>();
     MaxIngredients = new Dictionary <System.Type, double>();
     Ingredients[typeof(cheese)]      = new cheese();
     Ingredients[typeof(dough)]       = new dough();
     Ingredients[typeof(sauce)]       = new sauce();
     Ingredients[typeof(toppings)]    = new toppings();
     Ingredients[typeof(money)]       = new money();
     Ingredients[typeof(pizza)]       = new pizza();
     MaxIngredients[typeof(cheese)]   = 5;
     MaxIngredients[typeof(dough)]    = 10;
     MaxIngredients[typeof(sauce)]    = 5;
     MaxIngredients[typeof(toppings)] = 10;
     MaxIngredients[typeof(money)]    = 100000000000000000;
 }
예제 #17
0
        public ActionResult YuanGongJiaoFei(detail info)
        {
            ////添加缴费记录
            DetailManager a  = new DetailManager();
            var           qq = a.Add(info);

            if (qq)
            {
                //查询出总经费
                MoneyManager aa  = new MoneyManager();
                money        mys = aa.GetByPK(1);
                if (mys.overmoney == null)
                {
                    mys.overmoney = 0;
                }
                //修改总经费
                money my = new money();
                if (my.overmoney == null)
                {
                    my.overmoney = 0;
                }
                my.sunId     = 1;
                my.overmoney = (mys.overmoney + info.sum);
                my.openmoney = mys.openmoney + 0;
                MoneyManager aq  = new MoneyManager();
                var          boo = aq.Update(my);
                if (boo)
                {
                    return(Redirect("~/ZhengLiang/FinanceHT/YuanGongJiaoFei"));
                }

                else
                {
                    return(Redirect("~/ZhengLiang/FinanceHT/YuanGongJiaoFei"));
                }
            }
            else
            {
                return(Content("<script>alert('添加失败');window.location = '/ZhengLiang/FinanceHT/YuanGongJiaoFei';</script>"));
            }
        }
예제 #18
0
    protected void BtnConfirmar_Click(object sender, EventArgs e)
    {
        money mon = new money();

        long vr_tot = mon.getNumericValue(TxtDisp.Text) +
                      mon.getNumericValue(TxtMens.Text);

        string st_tot = mon.setMoneyFormat(vr_tot);

        GetConnection();

        string id_number = "";

        try
        {
            var_exchange.web_exec_confirmaBoleto(mon.getNumericValue(TxtMens.Text).ToString(),
                                                 mon.getNumericValue(TxtDisp.Text).ToString(),
                                                 Session["st_cartao"].ToString(),
                                                 ref id_number);


            TxtBolNome.Text   = Session["st_nomeResp"].ToString();
            TxtBolNumero.Text = id_number;
            TxtBolTot.Text    = st_tot.Replace(".", "");

            var_exchange.m_Client.ExitSession();
        }
        catch (System.Exception se)
        {
            if (se.Message == "Exit")
            {
                Session["st_error"]      = "Esgotado tempo de espera no servidor";
                Session["st_error_dest"] = "default.aspx";
                Response.Redirect("error.aspx", true);
            }
        }
    }
예제 #19
0
        public ActionResult Index()
        {
            Random rnd   = new Random();
            var    model = new List <money>();
            money  note;

            for (int i = 0; i < 200; i++)
            {
                note = new money();
                int rand = rnd.Next(2);
                if (rand == 1)
                {
                    note.Class = "支出";
                }
                else
                {
                    note.Class = "收入";
                }
                note.Date  = DateTime.Now.AddDays(rnd.Next(3650));
                note.Money = rnd.Next(10000);
                model.Add(note);
            }
            return(View(model));
        }
예제 #20
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                i_Form.Text += " " + st_cod_empresa.PadLeft(6, '0');

                i_Form.CboReport.SelectedIndex = 0;

                ctrl_TxtMes.AcquireTextBox(i_Form.TxtMes, this, event_val_TxtMes, 2);
                ctrl_TxtAno.AcquireTextBox(i_Form.TxtAno, this, event_val_TxtAno, 4);

                ctrl_TxtMes.SetTextBoxText(DateTime.Now.Month.ToString());
                ctrl_TxtAno.SetTextBoxText(DateTime.Now.Year.ToString());

                ArrayList lst = new ArrayList();

                string nome_emp = "";

                var_exchange.fetch_empresasAfiliadas(st_cod_empresa,
                                                     ref header,
                                                     ref nome_emp,
                                                     ref lst);

                for (int t = 0; t < lst.Count; ++t)
                {
                    DadosEmpresa de = new DadosEmpresa(lst [t] as DataPortable);

                    i_Form.CboAfiliada.Items.Add(de.get_st_empresa());
                }

                if (lst.Count == 0)
                {
                    i_Form.CboAfiliada.Items.Add("");
                }

                i_Form.CboAfiliada.SelectedIndex = 0;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                if (!ctrl_TxtAno.IsUserValidated && !ctrl_TxtMes.IsUserValidated)
                {
                    return(false);
                }

                switch (i_Form.CboReport.SelectedIndex)
                {
                case 0: doEvent(event_PorEmpresa, null);     break;

                case 1: doEvent(event_PorCartao, null);      break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtMes -

            case event_val_TxtMes:
            {
                //InitEventCode event_val_TxtMes

                if (ctrl_TxtMes.getTextBoxValue() == "" ||
                    ctrl_TxtMes.getTextBoxValue_Long() > 12)
                {
                    i_Form.TxtMes.BackColor     = colorInvalid;
                    ctrl_TxtMes.IsUserValidated = false;
                }
                else
                {
                    i_Form.TxtMes.BackColor     = Color.White;
                    ctrl_TxtMes.IsUserValidated = true;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtAno -

            case event_val_TxtAno:
            {
                //InitEventCode event_val_TxtAno

                if (ctrl_TxtAno.getTextBoxValue().Length < 4)
                {
                    i_Form.TxtAno.BackColor     = colorInvalid;
                    ctrl_TxtAno.IsUserValidated = false;
                }
                else
                {
                    i_Form.TxtAno.BackColor     = Color.White;
                    ctrl_TxtAno.IsUserValidated = true;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_PorEmpresa -

            case event_PorEmpresa:
            {
                //InitEventCode event_PorEmpresa

                // ##############################
                // # SETUP LISTS ################
                // ##############################

                ArrayList lstHeader     = new ArrayList();
                ArrayList lstContent    = new ArrayList();
                ArrayList lstTableSizes = new ArrayList();
                ArrayList lstFooter     = new ArrayList();
                ArrayList lstMessages   = new ArrayList();
                ArrayList lstFilters    = new ArrayList();

                string st_empresa             = "";
                string st_csv_cartao          = "";
                string st_csv_loja            = "";
                string st_csv_loja_content    = "";
                string st_csv_subtotal_loja   = "";
                string st_csv_subtotal_cartao = "";
                string st_csv_cartao_content  = "";
                string st_total = "";

                dlgStatus stat = new dlgStatus("Relatório");

                stat.LblActivity.Text = "Processando relatório no servidor";
                stat.Show();
                Application.DoEvents();

                if (!var_exchange.fetch_rel_3_fech("0",
                                                   ctrl_TxtMes.getTextBoxValue(),
                                                   ctrl_TxtAno.getTextBoxValue(),
                                                   st_cod_empresa,
                                                   i_Form.CboAfiliada.SelectedItem.ToString(),
                                                   ref header,
                                                   ref st_empresa,
                                                   ref st_csv_cartao,
                                                   ref st_csv_loja,
                                                   ref st_csv_loja_content,
                                                   ref st_csv_subtotal_loja,
                                                   ref st_csv_subtotal_cartao,
                                                   ref st_csv_cartao_content,
                                                   ref st_total))
                {
                    stat.Close();
                    return(false);
                }

                money     money_helper = new money();
                Hashtable mem_Lojas    = new Hashtable();

                stat.LblActivity.Text = "Obtendo resultados";

                Application.DoEvents();

                #region Busca todos os registros de todos as lojas
                {
                    ArrayList full_memory = new ArrayList();

                    while (st_csv_loja_content != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(st_csv_loja_content, "400", ref st_csv_loja_content, ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                full_memory.Add(tmp_memory[t]);
                            }
                        }
                    }

                    for (int t = 0; t < full_memory.Count; ++t)
                    {
                        DadosFechamento df = new DadosFechamento(full_memory[t] as DataPortable);

                        string tmp_loja = df.get_st_loja();

                        if (mem_Lojas [tmp_loja] == null)
                        {
                            mem_Lojas [tmp_loja] = new ArrayList();
                        }

                        ArrayList memoryLoja = mem_Lojas [tmp_loja] as ArrayList;

                        memoryLoja.Add(df);
                    }
                }
                #endregion

                stat.LblActivity.Text = "Gerando relatório para web";

                Application.DoEvents();

                int tot_Lojas = var_util.indexCSV(st_csv_loja);

                long tot_repasse = 0;

                ApplicationUtil var_utilFooter = new ApplicationUtil();

                var_utilFooter.indexCSV(st_csv_subtotal_loja);

                for (int h = 0; h < tot_Lojas; ++h)
                {
                    string loja = var_util.getCSV(h);

                    ArrayList memLojaList = mem_Lojas [loja] as ArrayList;

                    ArrayList lstFooterSub  = new ArrayList();
                    ArrayList lstHeaderSub  = new ArrayList();
                    ArrayList lstContentSub = new ArrayList();

                    lstMessages.Add("Fechamento da loja: " + loja);

                    lstTableSizes.Add(650);

                    lstHeaderSub.Add("NSU");
                    lstHeaderSub.Add("Cartão");
                    lstHeaderSub.Add("Nome");
                    lstHeaderSub.Add("Data e Hora");
                    lstHeaderSub.Add("Valor R$");
                    lstHeaderSub.Add("Parcela");
                    lstHeaderSub.Add("Terminal");

                    long sub_repasse = 0;

                    if (memLojaList != null)
                    {
                        for (int t = 0; t < memLojaList.Count; ++t)
                        {
                            DadosFechamento df = new DadosFechamento(memLojaList[t] as DataPortable);

                            ArrayList lstLine = new ArrayList();

                            lstLine.Add(df.get_st_nsu().PadLeft(6, '0'));
                            lstLine.Add(df.get_st_cartao());
                            lstLine.Add(df.get_st_nome());
                            lstLine.Add(var_util.getDDMMYYYY_format(df.get_dt_trans()));
                            lstLine.Add(money_helper.formatToMoney(df.get_vr_valor()));
                            lstLine.Add(df.get_nu_parcela());
                            lstLine.Add(df.get_st_terminal());

                            sub_repasse += Convert.ToInt64(df.get_vr_repasse());

                            lstContentSub.Add(lstLine);
                        }
                    }

                    lstFooterSub.Add("Sub-Total: " + "R$ " + money_helper.formatToMoney(var_utilFooter.getCSV(h)));
                    lstFooterSub.Add("Sub-Total repasse: " + "R$ " + money_helper.setMoneyFormat(sub_repasse));

                    tot_repasse += sub_repasse;

                    lstHeader.Add(lstHeaderSub);
                    lstFooter.Add(lstFooterSub);
                    lstContent.Add(lstContentSub);

                    if (h == tot_Lojas - 1)
                    {
                        lstFooterSub.Add("");
                        lstFooterSub.Add("Total de vendas nas lojas: " + "R$ " + money_helper.formatToMoney(st_total));
                        lstFooterSub.Add("Total de repasse para lojas: " + "R$ " + money_helper.setMoneyFormat(tot_repasse));
                    }
                }

                stat.Close();

                SyCrafReport rel = new SyCrafReport("Relatório de Fechamento por loja",
                                                    "RFE",
                                                    st_empresa,
                                                    "Mês " + ctrl_TxtMes.getTextBoxValue(),
                                                    "Ano " + ctrl_TxtAno.getTextBoxValue(),
                                                    ref lstHeader,
                                                    ref lstContent,
                                                    ref lstTableSizes,
                                                    ref lstFooter,
                                                    ref lstMessages,
                                                    ref lstFilters);


                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_PorCartao -

            case event_PorCartao:
            {
                //InitEventCode event_PorCartao

                // ##############################
                // # SETUP LISTS ################
                // ##############################

                ArrayList lstHeader     = new ArrayList();
                ArrayList lstContent    = new ArrayList();
                ArrayList lstTableSizes = new ArrayList();
                ArrayList lstFooter     = new ArrayList();
                ArrayList lstMessages   = new ArrayList();
                ArrayList lstFilters    = new ArrayList();

                string st_empresa             = "";
                string st_csv_cartao          = "";
                string st_csv_loja            = "";
                string st_csv_loja_content    = "";
                string st_csv_subtotal_loja   = "";
                string st_csv_subtotal_cartao = "";
                string st_csv_cartao_content  = "";
                string st_total = "";

                dlgStatus stat = new dlgStatus("Relatório");

                stat.LblActivity.Text = "Processando relatório no servidor";
                stat.Show();
                Application.DoEvents();

                if (!var_exchange.fetch_rel_3_fech("1",
                                                   ctrl_TxtMes.getTextBoxValue(),
                                                   ctrl_TxtAno.getTextBoxValue(),
                                                   st_cod_empresa,
                                                   i_Form.CboAfiliada.SelectedItem.ToString(),
                                                   ref header,
                                                   ref st_empresa,
                                                   ref st_csv_cartao,
                                                   ref st_csv_loja,
                                                   ref st_csv_loja_content,
                                                   ref st_csv_subtotal_loja,
                                                   ref st_csv_subtotal_cartao,
                                                   ref st_csv_cartao_content,
                                                   ref st_total))
                {
                    stat.Close();
                    return(false);
                }

                money     money_helper = new money();
                Hashtable mem_Cartoes  = new Hashtable();

                stat.LblActivity.Text = "Obtendo resultados";

                Application.DoEvents();

                #region Busca todos os registros de todos os cartoes
                {
                    ArrayList full_memory = new ArrayList();

                    while (st_csv_cartao_content != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(st_csv_cartao_content, "400", ref st_csv_cartao_content, ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                full_memory.Add(tmp_memory[t]);
                            }
                        }
                    }

                    for (int t = 0; t < full_memory.Count; ++t)
                    {
                        DadosFechamento df = new DadosFechamento(full_memory[t] as DataPortable);

                        string tmp_cartao = df.get_st_cartao();

                        if (mem_Cartoes [tmp_cartao] == null)
                        {
                            mem_Cartoes [tmp_cartao] = new ArrayList();
                        }

                        ArrayList memoryCart = mem_Cartoes [tmp_cartao] as ArrayList;

                        memoryCart.Add(df);
                    }
                }

                #endregion

                stat.LblActivity.Text = "Gerando relatório para web";

                Application.DoEvents();

                int tot_Cartoes = var_util.indexCSV(st_csv_cartao);

                ApplicationUtil var_utilFooter = new ApplicationUtil();

                var_utilFooter.indexCSV(st_csv_subtotal_cartao);

                for (int h = 0; h < tot_Cartoes; ++h)
                {
                    string cart = var_util.getCSV(h);

                    ArrayList lstFooterSub  = new ArrayList();
                    ArrayList lstHeaderSub  = new ArrayList();
                    ArrayList lstContentSub = new ArrayList();

                    lstMessages.Add("Fechamento do cartão: " + cart);

                    lstTableSizes.Add(800);

                    lstHeaderSub.Add("NSU");
                    lstHeaderSub.Add("Loja");
                    lstHeaderSub.Add("Data e Hora");
                    lstHeaderSub.Add("Valor R$");
                    lstHeaderSub.Add("Parcela");

                    ArrayList memCartList = mem_Cartoes [cart] as ArrayList;

                    if (memCartList != null)
                    {
                        for (int t = 0; t < memCartList.Count; ++t)
                        {
                            DadosFechamento df = new DadosFechamento(memCartList[t] as DataPortable);

                            ArrayList lstLine = new ArrayList();

                            lstLine.Add(df.get_st_nsu().PadLeft(6, '0'));
                            lstLine.Add(df.get_st_loja());
                            lstLine.Add(var_util.getDDMMYYYY_format(df.get_dt_trans()));
                            lstLine.Add(money_helper.formatToMoney(df.get_vr_valor()));
                            lstLine.Add(df.get_nu_parcela());

                            lstContentSub.Add(lstLine);
                        }
                    }

                    lstFooterSub.Add("Sub-Total: R$ " + money_helper.formatToMoney(var_utilFooter.getCSV(h)));

                    lstHeader.Add(lstHeaderSub);
                    lstFooter.Add(lstFooterSub);
                    lstContent.Add(lstContentSub);

                    if (h == tot_Cartoes - 1)
                    {
                        lstFooterSub.Add("");
                        lstFooterSub.Add("Total: " + "R$ " + money_helper.formatToMoney(st_total));
                    }
                }

                stat.Close();

                SyCrafReport rel = new SyCrafReport("Relatório de Fechamento por cartões",
                                                    "RFE",
                                                    st_empresa,
                                                    "Mês : " + ctrl_TxtMes.getTextBoxValue(),
                                                    "Ano : " + ctrl_TxtAno.getTextBoxValue(),
                                                    ref lstHeader,
                                                    ref lstContent,
                                                    ref lstTableSizes,
                                                    ref lstFooter,
                                                    ref lstMessages,
                                                    ref lstFilters);


                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BDF -

            case event_BDF:
            {
                //InitEventCode event_BDF

                if (i_Form.CboReport.SelectedIndex != 1)
                {
                    MessageBox.Show("Geração somente para relatório de cartões", "Aviso");
                    return(false);
                }

                event_dlgDBF_Fechamento ev_call = new event_dlgDBF_Fechamento(var_util, var_exchange);

                ev_call.header = header;

                ev_call.mes            = ctrl_TxtMes.getTextBoxValue();
                ev_call.ano            = ctrl_TxtAno.getTextBoxValue();
                ev_call.st_cod_empresa = st_cod_empresa;

                ev_call.i_Form.ShowDialog();

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnDBFClick -

            case event_BtnDBFClick:
            {
                //InitEventCode event_BtnDBFClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
예제 #21
0
        public ActionResult HuoDong(action info)
        {
            //查询出总经费
            MoneyManager aa  = new MoneyManager();
            money        mys = aa.GetByPK(1);

            if (info.actionneedmoney <= mys.overmoney)
            {
                ActionManager a  = new ActionManager();
                var           qq = a.Add(info);

                if (qq)
                {
                    //判断是否以批准,
                    if (info.actiontype.Equals("通过"))
                    {
                        if (mys.overmoney == null)
                        {
                            mys.overmoney = 0;
                        }
                        if (mys.openmoney == null)
                        {
                            mys.openmoney = 0;
                        }
                        //修改总经费
                        money my = new money();
                        if (my.overmoney == null)
                        {
                            my.overmoney = 0;
                        }
                        if (my.openmoney == null)
                        {
                            my.openmoney = 0;
                        }
                        my.sunId     = 1;
                        my.overmoney = (mys.overmoney - info.actionneedmoney);
                        my.openmoney = (mys.openmoney + info.actionneedmoney);
                        MoneyManager aq  = new MoneyManager();
                        var          boo = aq.Update(my);
                        if (boo)
                        {
                            return(Redirect("~/ZhengLiang/FinanceHT/HuoDong"));
                        }
                        else
                        {
                            return(Content("<script>alert('异常')</script>;window.location = '/ZhengLiang/FinanceHT/HuoDongJiLu');</script>"));
                        }
                    }
                    else
                    {
                        return(Redirect("~/ZhengLiang/FinanceHT/HuoDong"));
                    }
                }
                else
                {
                    return(Content("<script>alert('添加失败';window.location = '/ZhengLiang/FinanceHT/HuoDong');</script>"));
                }
            }
            else
            {
                return(Content("<script>alert('余额不足');window.location = '/ZhengLiang/FinanceHT/HuoDong';</script>"));
            }
        }
예제 #22
0
    void Start()
    {
        if (PlayerPrefs.GetInt("Skin0") == 0)
        {
            PlayerPrefs.SetInt("Skin0", 1);
        }


        if (Money == null)
        {
            Money = GameObject.FindGameObjectWithTag("MoneyUI").GetComponent <money>();
        }

        int skin = PlayerPrefs.GetInt("Skin");

        if (skin > -1)
        {
            PreviewPerso.sprite = Skin[skin];
        }

        int color = PlayerPrefs.GetInt("Color");

        if (color == 1)
        {
            PreviewPerso.color = new Color(1, 1, 0, 1);
        }
        if (color == 2)
        {
            PreviewPerso.color = new Color(1, 0.6987091f, 0, 1);
        }
        if (color == 3)
        {
            PreviewPerso.color = new Color(1, 0, 0, 1);
        }
        if (color == 4)
        {
            PreviewPerso.color = new Color(1, 0, 1, 1);
        }
        if (color == 5)
        {
            PreviewPerso.color = new Color(0, 0, 1, 1);
        }
        if (color == 6)
        {
            PreviewPerso.color = new Color(0, 1, 1, 1);
        }
        if (color == 7)
        {
            PreviewPerso.color = new Color(0, 1, 0, 1);
        }
        if (color == 8)
        {
            PreviewPerso.color = new Color(0.45f, 0.35f, 0, 1);
        }

        string name = "Skin" + (skin);

        if (PlayerPrefs.GetInt(name) == 1)
        {
            buttonBuy.SetActive(false);
        }
        else
        {
            buttonBuy.SetActive(true);
        }
    }
예제 #23
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                i_Form.TxtLoja.Text  = st_loja;
                i_Form.TxtValor.Text = "R$ " + new money().formatToMoney(vr_valor);

                ctrl_TxtIdent.AcquireTextBox(i_Form.TxtIdent, this, event_val_TxtIdent, 20);

                string banco = "";
                string ag    = "";
                string conta = "";

                var_exchange.fetch_convenioLojaGift(st_codLoja, ref header, ref banco, ref ag, ref conta);

                i_Form.TxtBanco.Text   = banco;
                i_Form.TxtAgencia.Text = ag;
                i_Form.TxtConta.Text   = conta;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                if (!i_Form.rbCheque.Checked &&
                    !i_Form.rbDep.Checked &&
                    !i_Form.rbDinheiro.Checked)
                {
                    return(false);
                }

                if (i_Form.rbCheque.Checked &&
                    !ctrl_TxtIdent.IsUserValidated)
                {
                    MessageBox.Show("Preencha a identificação do cheque", "Aviso");
                    return(false);
                }

                string tg_opcao = "0";                         // dinheiro

                if (i_Form.rbCheque.Checked)
                {
                    tg_opcao = "1";
                }
                if (i_Form.rbDep.Checked)
                {
                    tg_opcao = "2";
                }

                vr_valor = vr_valor.Replace("R$", "");

                var_exchange.exec_repasseLoja(st_codLoja,
                                              tg_opcao,
                                              ctrl_TxtIdent.getTextBoxValue(),
                                              new money().getNumericValue(vr_valor).ToString(),
                                              ref header,
                                              ref lstParcelas,
                                              ref id_confRepasse);


                bool IsPrinted = false;

                while (!IsPrinted)
                {
                    PrintDocument pd      = new PrintDocument();
                    PrintDialog   pDialog = new PrintDialog();

                    pDialog.Document = pd;

                    PrintPreviewDialog prevDialog = new PrintPreviewDialog();
                    prevDialog.Document = pd;

                    pd.PrintPage += new PrintPageEventHandler(i_Form.Inven_Report);
                    prevDialog.ShowDialog();

                    if (pDialog.ShowDialog() == DialogResult.OK)
                    {
                        pd.Print();
                    }

                    if (MessageBox.Show("Imprimiiu corretamente?",
                                        "Aviso",
                                        MessageBoxButtons.YesNo,
                                        MessageBoxIcon.Question,
                                        MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    {
                        IsPrinted = true;
                    }
                }

                i_Form.Close();

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtIdent -

            case event_val_TxtIdent:
            {
                //InitEventCode event_val_TxtIdent

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtIdent.Text.Length > 0)
                    {
                        i_Form.TxtIdent.BackColor     = Color.White;
                        ctrl_TxtIdent.IsUserValidated = true;
                        ctrl_TxtIdent.CleanError();
                    }
                    else
                    {
                        i_Form.TxtIdent.BackColor     = colorInvalid;
                        ctrl_TxtIdent.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Print -

            case event_Print:
            {
                //InitEventCode event_Print

                DadosRepRecibo drr = new DadosRepRecibo();

                ArrayList lstRec = new ArrayList();

                var_exchange.fetch_reciboRepasse(id_confRepasse,
                                                 ref header,
                                                 ref drr,
                                                 ref lstRec);

                PrintPageEventArgs e = arg as PrintPageEventArgs;

                Graphics g      = e.Graphics;
                int      n      = 0;
                Font     myFont = new Font("Courier New", 10);

                try
                {
                    g.DrawString("RECIBO DE CONFIRMAÇÃO DO REPASSE FINANCEIRO", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString(DateTime.Now.ToLongDateString().ToUpper(), myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("Nome da loja: " + drr.get_loja(), myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("CNPJ: " + drr.get_cnpj(), myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;

                    if (drr.get_pagto() == TipoPagamento.Dinheiro)
                    {
                        g.DrawString("Forma pagamento: dinheiro ", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    }
                    else if (drr.get_pagto() == TipoPagamento.Cheque)
                    {
                        g.DrawString("Forma pagamento: Cheque " + drr.get_st_extra(), myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    }
                    else
                    {
                        g.DrawString("Forma pagamento: Depósito " + drr.get_st_extra(), myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    }

                    string tipo_pag = "";

                    g.DrawString(tipo_pag, myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("Cartão            Data e Hora          NSU       Valor     Data Vencimento", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("------------------------------------------------------------------------------------", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;

                    for (int t = 0; t < lstRec.Count; ++t)
                    {
                        DadosRepasse port = new DadosRepasse(lstRec[t] as DataPortable);

                        string line = port.get_st_cartao().PadRight(18, ' ');

                        line += var_util.getDDMMYYYY_format(port.get_dt_trans()).PadRight(21, ' ');
                        line += port.get_st_nsu().PadRight(10, ' ');
                        line += new money().formatToMoney(port.get_vr_total()).PadRight(10, ' ');
                        line += var_util.getDDMMYYYY_format(port.get_dt_repasse()).PadRight(21, ' ');

                        g.DrawString(line, myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    }

                    g.DrawString("", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("Valor das compras: R$ " + new money().formatToMoney(drr.get_vr_compras()), myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("Taxa de administração: " + drr.get_tx_admin(), myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("Desconto: R$ " + drr.get_vr_desc(), myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("Valor total do reembolso: " + new money().formatToMoney(drr.get_vr_tot_rep()), myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("____________________________________________", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    g.DrawString("Assinatura do responsável", myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;

                    myFont.Dispose();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message.ToString());
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtVrAbatimento.AcquireTextBox(i_Form.TxtVrAbatimento, this, event_val_TxtVrAbatimento, "R$", 12);
                ctrl_TxtJuros.AcquireTextBox(i_Form.TxtJuros, this, event_val_TxtJuros, 5, 2);
                ctrl_TxtCodigo.AcquireTextBox(i_Form.TxtCodigo, this, event_val_TxtCodigo, 6);
                ctrl_TxtVrPago.AcquireTextBox(i_Form.TxtVrPago, this, event_val_TxtVrPago, "R$", 12);
                ctrl_TxtMotivo.AcquireTextBox(i_Form.TxtMotivo, this, event_val_TxtMotivo, 20);

                ctrl_TxtVrAbatimento.SetTextBoxString("0");
                ctrl_TxtJuros.SetTextBoxText("1000");

                i_Form.TxtTotal.Text = "R$ " + new money().formatToMoney(vr_total.ToString());

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCodigo -

            case event_val_TxtCodigo:
            {
                //InitEventCode event_val_TxtCodigo

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtCodigo.Text.Length > 0)
                    {
                        i_Form.TxtCodigo.BackColor     = Color.White;
                        ctrl_TxtCodigo.IsUserValidated = true;
                        ctrl_TxtCodigo.CleanError();

                        if (ctrl_TxtCodigo.GetEnterPressed())
                        {
                            if (i_Form.CboTipo.SelectedIndex != -1)
                            {
                                string msg        = "";
                                string tg_empresa = Context.FALSE;
                                string vr_valor   = "";

                                if (i_Form.CboTipo.SelectedIndex == 0)
                                {
                                    tg_empresa = Context.TRUE;
                                }

                                if (var_exchange.fetch_dadosFaturamento(tg_empresa,
                                                                        ctrl_TxtCodigo.getTextBoxValue(),
                                                                        ref header,
                                                                        ref msg,
                                                                        ref vr_valor))
                                {
                                    vr_total = Convert.ToInt64(vr_valor);

                                    doEvent(event_CalcParcela, null);
                                }
                            }
                        }
                    }
                    break;
                }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtVrPago -

            case event_val_TxtVrPago:
            {
                //InitEventCode event_val_TxtVrPago

                doEvent(event_CalcParcela, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtJuros -

            case event_val_TxtJuros:
            {
                //InitEventCode event_val_TxtJuros

                doEvent(event_CalcParcela, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtVrAbatimento -

            case event_val_TxtVrAbatimento:
            {
                //InitEventCode event_val_TxtVrAbatimento

                doEvent(event_CalcParcela, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtMotivo -

            case event_val_TxtMotivo:
            {
                //InitEventCode event_val_TxtMotivo
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmar -

            case event_BtnConfirmar:
            {
                //InitEventCode event_BtnConfirmar

                if (ctrl_TxtCodigo.getTextBoxValue().Length == 0)
                {
                    return(false);
                }

                if (i_Form.TxtMotivo.Text.Length == 0)
                {
                    MessageBox.Show("Informe o motivo corretamente", "Aviso");
                    return(false);
                }

                if (MessageBox.Show("Confirma o valor de despesa " + i_Form.TxtVrDevido.Text + "?",
                                    "Aviso",
                                    MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question,
                                    MessageBoxDefaultButton.Button2) == DialogResult.No)
                {
                    return(false);
                }

                string st_val_juro = i_Form.TxtVrDevido.Text.Replace("R$ ", "");

                long valor_juro = new money().getNumericValue(st_val_juro);
                long valor_pago = ctrl_TxtVrPago.getTextBoxValue_Long();

                string emp      = Context.FALSE;
                string desconto = Context.FALSE;

                if (i_Form.CboTipo.SelectedIndex == 0)
                {
                    emp = Context.TRUE;
                }

                if (!var_exchange.exec_fat_recManual(emp,
                                                     ctrl_TxtCodigo.getTextBoxValue(),
                                                     valor_pago.ToString(),
                                                     ref header))
                {
                    return(false);
                }

                if (valor_juro > 0)
                {
                    var_exchange.ins_despesa(valor_juro.ToString(),
                                             ctrl_TxtCodigo.getTextBoxValue(),
                                             emp,
                                             i_Form.TxtMotivo.Text,
                                             desconto,
                                             ref header);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_CalcParcela -

            case event_CalcParcela:
            {
                //InitEventCode event_CalcParcela

                if (i_Form.TxtVrPago.Text.Length == 0)
                {
                    return(false);
                }

                if (i_Form.TxtJuros.Text.Length == 0)
                {
                    return(false);
                }

                if (i_Form.TxtVrAbatimento.Text.Length == 0)
                {
                    return(false);
                }

                i_Form.TxtTotal.Text = "R$ " + new money().formatToMoney(vr_total.ToString());

                long desc = vr_total - ctrl_TxtVrPago.getTextBoxValue_Long();

                i_Form.TxtVrDesc.Text = "R$ " + new money().formatToMoney(desc.ToString());

                long jur  = (long)ctrl_TxtJuros.getTextBoxValue_Double() * vr_total / 100;
                long abat = ctrl_TxtVrAbatimento.getTextBoxValue_Long();

                i_Form.TxtVrDevido.Text = "R$ " + new money().formatToMoney((desc + jur - abat).ToString());

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                if (header.get_tg_user_type() == TipoUsuario.Lojista)
                {
                    ArrayList lst = new ArrayList();

                    var_exchange.fetch_lojistaEmpresas(header.get_st_empresa(), ref header, ref lst);

                    for (int t = 0; t < lst.Count; ++t)
                    {
                        DadosEmpresa de = new DadosEmpresa(lst[t] as DataPortable);

                        i_Form.LstEmp.Items.Add(de.get_st_empresa() + " " + de.get_st_fantasia());
                    }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                if (i_Form.LstEmp.SelectedIndex == -1)
                {
                    return(false);
                }

                string st_empresa = i_Form.LstEmp.SelectedItem.ToString();

                st_empresa = st_empresa.Substring(0, st_empresa.IndexOf(" "));

                // ##############################
                // # SETUP LISTS ################
                // ##############################

                ArrayList lstHeader     = new ArrayList();
                ArrayList lstContent    = new ArrayList();
                ArrayList lstTableSizes = new ArrayList();
                ArrayList lstFooter     = new ArrayList();
                ArrayList lstMessages   = new ArrayList();
                ArrayList lstFilters    = new ArrayList();

                // ##############################
                // # CUSTOMIZE
                // ##############################

                string st_csv_contents = "";

                dlgStatus stat = new dlgStatus("Relatório");

                stat.LblActivity.Text = "Processando relatório no servidor";
                stat.Show();
                Application.DoEvents();

                if (!var_exchange.fetch_rel_prevLojista(st_empresa,
                                                        ref header,
                                                        ref st_csv_contents))
                {
                    stat.Close();
                    return(false);
                }

                ArrayList full_memory = new ArrayList();

                stat.LblActivity.Text = "Buscando detalhes...";
                Application.DoEvents();

                while (st_csv_contents != "")
                {
                    ArrayList tmp_memory = new ArrayList();

                    if (var_exchange.fetch_memory(st_csv_contents, "400", ref st_csv_contents, ref tmp_memory))
                    {
                        for (int t = 0; t < tmp_memory.Count; ++t)
                        {
                            full_memory.Add(tmp_memory[t]);
                        }
                    }
                }

                money money_helper = new money();

                stat.LblActivity.Text = "Gerando relatório para web";
                Application.DoEvents();

                lstMessages.Add("Transações confirmadas para a loja: " + header.get_st_empresa());

                lstTableSizes.Add(650);

                ArrayList lst_sub_tbl_head = new ArrayList();

                lst_sub_tbl_head.Add("Cartão");
                lst_sub_tbl_head.Add("NSU");
                lst_sub_tbl_head.Add("Data e Hora");
                lst_sub_tbl_head.Add("Parcela");
                lst_sub_tbl_head.Add("Valor R$");
                lst_sub_tbl_head.Add("Valor Repasse R$");

                lstHeader.Add(lst_sub_tbl_head);

                long tot_repasse = 0;

                ArrayList my_line_container = new ArrayList();

                for (int t = 0; t < full_memory.Count; ++t)
                {
                    DadosRepasse dr = new DadosRepasse(full_memory[t] as DataPortable);

                    ArrayList lst_line_content = new ArrayList();

                    lst_line_content.Add(dr.get_st_cartao());
                    lst_line_content.Add(dr.get_st_nsu());
                    lst_line_content.Add(var_util.getDDMMYYYY_format(dr.get_dt_trans()));
                    lst_line_content.Add(dr.get_id_parcela());
                    lst_line_content.Add(money_helper.formatToMoney(dr.get_vr_total()));
                    lst_line_content.Add(money_helper.formatToMoney(dr.get_vr_repasse()));

                    tot_repasse += Convert.ToInt64(dr.get_vr_repasse());

                    my_line_container.Add(lst_line_content);
                }

                lstContent.Add(my_line_container);

                ArrayList lst_sub_foot = new ArrayList();

                lst_sub_foot.Add("Total de repasse: " + money_helper.formatToMoney(tot_repasse.ToString()));

                lstFooter.Add(lst_sub_foot);

                stat.Close();

                SyCrafReport rel = new SyCrafReport("Relatório de previsão de repasse ao lojista",
                                                    "RPR",
                                                    i_Form.LstEmp.SelectedItem.ToString(),
                                                    var_util.getDDMMYYYY_format(DateTime.Now.ToString()),
                                                    "",
                                                    ref lstHeader,
                                                    ref lstContent,
                                                    ref lstTableSizes,
                                                    ref lstFooter,
                                                    ref lstMessages,
                                                    ref lstFilters);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
예제 #26
0
        public void import()
        {
            //test changes in source control
            int cost, id = 0, receiptno = 0;
            try
            {
                receiptno = int.Parse(Request.Form["receiptno"]);
                cost = int.Parse(Request.Form["cost"]);
            }
            catch (Exception e)
            {
                Response.Write("Please enter cost and reciept number");
                return;
            }
            if (Request.Form["id"] != "" && Request.Form["id"] != null)
            {
                id = int.Parse(Request.Form["id"]);
            }
            string name = Request.Form["name"];

            if (Request.Form["day"] == "" || Request.Form["day"] == null)
            {
                Response.Write("you must select day first");

                return;
            }
            DateTime day;
            CultureInfo enUS = new CultureInfo("en-US");
            DateTime.TryParseExact(Request.Form["day"], "yyyy-MM-dd", enUS,
                        DateTimeStyles.None, out day);

            teethLabEntities db = new teethLabEntities();
            int dayId = 0;
            moneyDay md = new moneyDay();
            if (db.moneyDays.Where(o => o.day.Year == day.Year
                && o.day.Month == day.Month
                && o.day.Day == day.Day).Count() > 0)
            {
                md = db.moneyDays.Where(o => o.day.Year == day.Year
                && o.day.Month == day.Month
                && o.day.Day == day.Day
                ).First();
                md.credit += cost;
                db.Entry(md).State = System.Data.EntityState.Modified;

            }
            else
            {
                Response.Write("you must select day first");
                return;
            }

            db.SaveChanges();
            dayId = md.id;
            db = new teethLabEntities();

            money m = new money();
            m.dayId = dayId;
            if (id != 0)
            {
                m.doctorId = id;
                try
                {
                    m.fromTo = name;
                }
                catch (Exception e)
                {
                    m.fromTo = "طبيب";
                }
            }
            else if (name != "" || name != null)
            {
                m.fromTo = name;
            }
            if (db.moneys.Where(o => o.receiptno == receiptno).Count() > 0)
            {
                Response.Write("receipt number cannot duplicated");
                return;
            }
            m.receiptno = receiptno;
            m.type = "import";
            m.recieveDate = DateTime.Now;
            m.value = cost;
            db.Entry(m).State = System.Data.EntityState.Added;
            db.moneys.Add(m);
            db.SaveChanges();
            if (id != 0)
            {
                db = new teethLabEntities();
                doctor doc = db.doctors.Find(id);
                doc.depit -= cost;
                db.Entry(doc).State = System.Data.EntityState.Modified;
                db.SaveChanges();
            }
            Response.Write("success");
        }
예제 #27
0
    protected void BtnConfirmar(object sender, EventArgs e)
    {
        GetConnection();

        money money_helper = new money();

        try
        {
            DateTime t_start = (DateTime)DtIni.SelectedDate;
            DateTime t_end   = (DateTime)DtFim.SelectedDate;

            t_start = new DateTime(t_start.Year, t_start.Month, t_start.Day);

            string st_csv           = "";
            string st_total_periodo = "";

            GetConnection();

            if (!var_exchange.web_fetch_rel_edu_extrato(Session["st_cartao"].ToString(),
                                                        var_util.DESCript(TxtSenha.Value.PadLeft(8, '*'), "12345678"),
                                                        var_util.GetDataBaseTimeFormat((DateTime)t_start),
                                                        var_util.GetDataBaseTimeFormat((DateTime)t_end.AddHours(23).AddMinutes(59).AddSeconds(59)),
                                                        SyCrafEngine.Context.TRUE,
                                                        ref st_csv,
                                                        ref st_total_periodo))
            {
                var_exchange.m_Client.ExitSession();

                Session["st_error"]      = var_exchange.m_Client.GetServerMessage();
                Session["st_error_dest"] = "RespExt.aspx";
                Response.Redirect("error.aspx", true);
                return;
            }

            RptExtrato.Visible = true;
            LblExtrato.Visible = true;

            LblExtrato.Text = "Extrato de atividades do cartão: " + DtIni.SelectedDate.ToShortDateString() + " até " + DtFim.SelectedDate.ToShortDateString();

            ArrayList values = new ArrayList();

            ArrayList desc    = new TipoConfirmacaoDesc().GetArray();
            ArrayList desc_op = new OperacaoCartaoDesc().GetArray();

            while (st_csv != "")
            {
                ArrayList list = new ArrayList();

                var_exchange.fetch_memory(st_csv, "400", ref st_csv, ref list);

                for (int t = 0; t < list.Count; ++t)
                {
                    EduExtrato rel_line = new EduExtrato(list[t] as DataPortable);

                    PositionData_ExtratoEdu bind = new PositionData_ExtratoEdu();

                    bind.nsu      = rel_line.get_st_nsu();
                    bind.data     = var_util.getDDMMYYYY_format(rel_line.get_dt_trans());
                    bind.valor    = money_helper.formatToMoney(rel_line.get_vr_valor());
                    bind.loja     = rel_line.get_st_loja();
                    bind.saldo    = money_helper.formatToMoney(rel_line.get_vr_disp());
                    bind.fundo    = money_helper.formatToMoney(rel_line.get_vr_fundo());
                    bind.operacao = desc_op[Convert.ToInt32(rel_line.get_en_oper())].ToString();

                    values.Add(bind);
                }
            }

            RptExtrato.DataSource = values;
            RptExtrato.DataBind();

            var_exchange.m_Client.ExitSession();
        }
        catch (System.Exception se)
        {
            if (se.Message == "Exit")
            {
                Session["st_error"]      = "Esgotado tempo de espera no servidor";
                Session["st_error_dest"] = "default.aspx";
                Response.Redirect("error.aspx", true);
            }
        }
    }
예제 #28
0
 void init()
 {
     camera = GameObject.FindWithTag("cam");
     money  = camera.GetComponent <money>();
 }
예제 #29
0
파일: money.cs 프로젝트: sakiiya/Game_2
 void Start()
 {
     pay = this;
 }
예제 #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            GetConnection();

            string st_csv = "";

            try
            {
                var_exchange.web_fetch_edu_ranking(ref st_csv);

                money money_helper = new money();

                ArrayList values = new ArrayList();

                //            string var_tmp_listCSV = "";

                var_util.clearPortable();

                //              var_util.indexCSV(st_csv);
//                var_util.setBatchAmount(var_util.max_pack / 250);

                //          while (var_util.nextBatch(ref var_tmp_listCSV) == true)
                {
                    ArrayList list = new ArrayList();

                    /*
                     * if (var_exchange.fetch_memory(var_tmp_listCSV, ref list))
                     * {
                     *  for (int t = 0; t < list.Count; ++t)
                     *  {
                     *      DadosRanking rnk = new DadosRanking(list[t] as DataPortable);
                     *
                     *      PositionData_Ranking bind = new PositionData_Ranking();
                     *
                     *      bind.pos   = rnk.get_st_pos();
                     *      bind.nome  = rnk.get_st_nome();
                     *      bind.valor = money_helper.formatToMoney(rnk.get_vr_valor());
                     *
                     *      values.Add(bind);
                     *  }
                     * }
                     * */
                }

                var_exchange.m_Client.ExitSession();

                RptRanking.DataSource = values;
                RptRanking.DataBind();
            }
            catch (System.Exception se)
            {
                if (se.Message == "Exit")
                {
                    Session["st_error"]      = "Esgotado tempo de espera no servidor";
                    Session["st_error_dest"] = "default.aspx";
                    Response.Redirect("error.aspx", true);
                }
            }
        }
    }
예제 #31
0
 Amount = FindRoundingStrategy(money, context).Round(money.Amount)
예제 #32
0
        public void export()
        {
            int cost = 0;
            try
            {
                cost = int.Parse(Request.Form["cost"]);
            }
            catch (Exception e)
            {
                return;
            }
            int id = 0;
            try
            {
                id = int.Parse(Request.Form["id"]);
            }
            catch (Exception e)
            {

            }

            string name = Request.Form["name"];
            if (name == "" || name == null)
            {
                return;
            }
            string type = Request.Form["type"];

            teethLabEntities db = new teethLabEntities();

            int dayId = 0;
            DateTime day;
            CultureInfo enUS = new CultureInfo("en-US");
            DateTime.TryParseExact(Request.Form["day"], "yyyy-MM-dd", enUS,
                        DateTimeStyles.None, out day);

            moneyDay md = new moneyDay();

            if (db.moneyDays.Where(o => o.day.Year == day.Year
            && o.day.Month == day.Month
                && o.day.Day == day.Day).Count() > 0)
            {
                md = db.moneyDays.Where(o => o.day.Year == day.Year
                && o.day.Month == day.Month
                && o.day.Day == day.Day
                ).First();
                md.credit -= cost;
                db.Entry(md).State = System.Data.EntityState.Modified;

            }
            else
            {
                return;
            }

            db.SaveChanges();
            dayId = md.id;

            db = new teethLabEntities();
            money m = new money();
            m.dayId = dayId;

            m.fromTo = name;

            m.type = "export";
            m.value = cost;
            m.recieveDate = DateTime.Now;

            if (type == "new")
            {

            }
            else if (type == "Doctor")
            {
                m.doctorId = id;
            }
            else if (type == "Company")
            {
                m.companyId = id;
            }
            else if (type == "Employee")
            {
                m.employeeId = id;
            }

            db.Entry(m).State = System.Data.EntityState.Added;
            db.moneys.Add(m);
            db.SaveChanges();

            db = new teethLabEntities();
            if (type == "Company")
            {

                product p = new product();
                p.companyId = id;
                p.enterDate = day;
                p.name = name;//
                p.isFinished = false;
                p.price = cost;
                db.Entry(p).State = System.Data.EntityState.Added;

            }
            else if (type == "Doctor")
            {
                doctor doc = db.doctors.Find(id);
                db.Entry(doc).State = System.Data.EntityState.Modified;
                doc.depit += cost;

            }
            db.SaveChanges();
            Response.Write("success");
        }
예제 #33
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtDtIni.AcquireTextBox(i_Form.TxtDtIni, this, event_val_TxtDtIni, dateTextController.FORMAT_DDMMYYYY);
                ctrl_TxtDtFim.AcquireTextBox(i_Form.TxtDtFim, this, event_val_TxtDtFim, dateTextController.FORMAT_DDMMYYYY);

                ctrl_TxtDtIni.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);
                ctrl_TxtDtFim.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);

                ctrl_TxtDtIni.SetTextBoxText("01" +
                                             DateTime.Now.Month.ToString().PadLeft(2, '0') +
                                             DateTime.Now.Year.ToString().PadLeft(4, '0'));


                ctrl_TxtDtFim.SetTextBoxText("15" +
                                             DateTime.Now.Month.ToString().PadLeft(2, '0') +
                                             DateTime.Now.Year.ToString().PadLeft(4, '0'));


                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDtIni -

            case event_val_TxtDtIni:
            {
                //InitEventCode event_val_TxtDtIni

                switch (arg as string)
                {
                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDtIni.BackColor     = Color.White;
                    ctrl_TxtDtIni.IsUserValidated = true;
                    ctrl_TxtDtIni.CleanError();
                    break;
                }

                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDtIni.BackColor     = colorInvalid;
                    ctrl_TxtDtIni.IsUserValidated = false;
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDtFim -

            case event_val_TxtDtFim:
            {
                //InitEventCode event_val_TxtDtFim

                switch (arg as string)
                {
                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDtFim.BackColor     = Color.White;
                    ctrl_TxtDtFim.IsUserValidated = true;
                    ctrl_TxtDtFim.CleanError();
                    break;
                }

                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDtFim.BackColor     = colorInvalid;
                    ctrl_TxtDtFim.IsUserValidated = false;
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                bool bOk = true;

                if (!ctrl_TxtDtFim.IsUserValidated)
                {
                    ctrl_TxtDtFim.SetErrorMessage("Informe o dia final");
                    bOk = false;
                }

                if (!ctrl_TxtDtIni.IsUserValidated)
                {
                    ctrl_TxtDtIni.SetErrorMessage("Informe o dia inicial");
                    bOk = false;
                }

                if (i_Form.CboRelat.SelectedIndex == -1)
                {
                    MessageBox.Show("Informe a opção de cobrança", "Aviso");
                    bOk = false;
                }

                if (!bOk)
                {
                    return(false);
                }

                i_Form.BtnConfirmar.Enabled = false;

                if (i_Form.CboRelat.SelectedIndex == 0)
                {
                    #region - pendentes com detalhe -

                    // ##############################
                    // # SETUP LISTS ################
                    // ##############################

                    ArrayList lstHeader     = new ArrayList();
                    ArrayList lstContent    = new ArrayList();
                    ArrayList lstTableSizes = new ArrayList();
                    ArrayList lstFooter     = new ArrayList();
                    ArrayList lstMessages   = new ArrayList();
                    ArrayList lstFilters    = new ArrayList();

                    // ##############################
                    // # CUSTOMIZE
                    // ##############################

                    string output_st_total                 = "";
                    string output_st_total_desconto        = "";
                    string output_st_csv_subtotal          = "";
                    string output_st_csv_subtotal_desconto = "";
                    string output_st_content_block         = "";
                    string output_st_emp_loj_block         = "";

                    string output_CartaoAtiv = "";
                    string output_Extras     = "";
                    string output_FixoTrans  = "";
                    string output_Percent    = "";
                    string output_TBM        = "";

                    i_Form.Visible = false;

                    dlgStatus stat = new dlgStatus("Relatório");

                    stat.LblActivity.Text = "Processando relatório no servidor";
                    stat.Show();
                    Application.DoEvents();

                    if (!var_exchange.fetch_rel_6_fat(var_util.GetDataBaseTimeFormat(ctrl_TxtDtIni.getTextBoxValue_Date()),
                                                      var_util.GetDataBaseTimeFormat(ctrl_TxtDtFim.getTextBoxValue_Date().AddDays(1)),
                                                      ref header,
                                                      ref output_st_total,
                                                      ref output_st_total_desconto,
                                                      ref output_st_csv_subtotal,
                                                      ref output_st_csv_subtotal_desconto,
                                                      ref output_st_content_block,
                                                      ref output_st_emp_loj_block,
                                                      ref output_CartaoAtiv,
                                                      ref output_Extras,
                                                      ref output_FixoTrans,
                                                      ref output_Percent,
                                                      ref output_TBM))
                    {
                        stat.Close();
                        return(false);
                    }

                    stat.LblActivity.Text = "Buscando detalhes de faturamento";
                    Application.DoEvents();

                    // index de todos os itens de cobrança
                    Hashtable hsh_Memory = new Hashtable();

                    while (output_st_content_block != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(output_st_content_block, "200",
                                                      ref output_st_content_block,
                                                      ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                Rel_FAT f_t = new Rel_FAT(tmp_memory [t] as DataPortable);

                                if (hsh_Memory [f_t.get_fk_fatura()] == null)
                                {
                                    hsh_Memory [f_t.get_fk_fatura()] = new ArrayList();
                                }

                                ArrayList tmp = hsh_Memory [f_t.get_fk_fatura()] as ArrayList;

                                tmp.Add(f_t);
                            }
                        }
                    }

                    // lista de todas as empresas e lojas
                    ArrayList full_memory_ent = new ArrayList();

                    stat.LblActivity.Text = "Buscando lista de lojas e empresas";
                    Application.DoEvents();

                    while (output_st_emp_loj_block != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(output_st_emp_loj_block, "200",
                                                      ref output_st_emp_loj_block,
                                                      ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                Entidade ent = new Entidade(tmp_memory[t] as DataPortable);

                                full_memory_ent.Add(ent);
                            }
                        }
                    }

                    stat.LblActivity.Text = "Gerando relatório para web";
                    Application.DoEvents();

                    stat.pgStatus.Maximum = full_memory_ent.Count;
                    stat.pgStatus.Minimum = 0;

                    money money_helper = new money();

                    // tradução do indice para texto
                    ArrayList desc = new TipoFatDesc().GetArray();

                    // Passa por todas as empresas e lojas
                    for (int g = 0; g < full_memory_ent.Count; ++g)
                    {
                        Entidade ent = full_memory_ent [g] as Entidade;

                        stat.pgStatus.Value = g + 1;

                        Application.DoEvents();

                        // Sub-título
                        lstMessages.Add(ent.get_st_nome());
                        lstTableSizes.Add(500);

                        ArrayList lst_sub_tbl_head = new ArrayList();

                        lst_sub_tbl_head.Add("Descrição de item faturado");
                        lst_sub_tbl_head.Add("Valor Cobrança R$");

                        lstHeader.Add(lst_sub_tbl_head);

                        // Lista de items
                        ArrayList my_cobranca = new ArrayList();

                        // Obtem index da memoria
                        ArrayList lstMemory = hsh_Memory [ent.get_fk_fatura()] as ArrayList;

                        if (lstMemory == null)
                        {
                            my_cobranca.Add(new ArrayList());
                        }
                        else
                        {
                            for (int t = 0; t < lstMemory.Count; ++t)
                            {
                                Rel_FAT f_t = lstMemory [t] as Rel_FAT;

                                // Lista de items para uma linha
                                ArrayList lst_sub_content = new ArrayList();

                                string st_desc = "";
                                string vr_cob  = "";

                                switch (f_t.get_tg_tipoFat())
                                {
                                case TipoFat.Extras:            st_desc = "Extra: " + f_t.get_st_extra();       break;

                                case TipoFat.TBM:                       st_desc = "Tarifa básica mensal";                       break;

                                case TipoFat.CartaoAtiv:        st_desc = "Tarifa por cartões ativos";          break;

                                case TipoFat.FixoTrans:         st_desc = "Valor sobre Transações";             break;

                                case TipoFat.Percent:           st_desc = "Percentual sobre Transações";        break;

                                default: break;
                                }

                                if (f_t.get_tg_desconto() == Context.TRUE)
                                {
                                    vr_cob = "-" + f_t.get_vr_cob();
                                }
                                else
                                {
                                    vr_cob = f_t.get_vr_cob();
                                }

                                lst_sub_content.Add(st_desc);
                                lst_sub_content.Add(money_helper.formatToMoney(vr_cob));

                                my_cobranca.Add(lst_sub_content);
                            }
                        }

                        lstContent.Add(my_cobranca);

                        ArrayList lst_sub_foot = new ArrayList();

                        var_util.indexCSV(output_st_csv_subtotal);
                        lst_sub_foot.Add("Sub-Total: R$ " + money_helper.formatToMoney(var_util.getCSV(g)));

                        var_util.indexCSV(output_st_csv_subtotal_desconto);
                        lst_sub_foot.Add("Sub-Total desconto: R$ " + money_helper.formatToMoney(var_util.getCSV(g)));

                        if (g == full_memory_ent.Count - 1)
                        {
                            lst_sub_foot.Add("");
                            lst_sub_foot.Add("Total de faturamento no período: R$ " + money_helper.formatToMoney(output_st_total));
                            lst_sub_foot.Add("Total em descontos no faturamento no período: R$ " + money_helper.formatToMoney(output_st_total_desconto));
                            lst_sub_foot.Add("");
                            lst_sub_foot.Add("Valor em cartões ativos: " + money_helper.formatToMoney(output_CartaoAtiv));
                            lst_sub_foot.Add("Valor em despesas extras: " + money_helper.formatToMoney(output_Extras));
                            lst_sub_foot.Add("Valor fixo por transações: " + money_helper.formatToMoney(output_FixoTrans));
                            lst_sub_foot.Add("Valor por percentual em transações: " + money_helper.formatToMoney(output_Percent));
                            lst_sub_foot.Add("Valor em mensalidades: " + money_helper.formatToMoney(output_TBM));
                        }

                        lstFooter.Add(lst_sub_foot);
                    }

                    stat.Close();

                    SyCrafReport rel = new SyCrafReport("Relatório de faturamento pendente",
                                                        "RFP",
                                                        "",
                                                        ctrl_TxtDtIni.getTextBoxValue(),
                                                        ctrl_TxtDtFim.getTextBoxValue(),
                                                        ref lstHeader,
                                                        ref lstContent,
                                                        ref lstTableSizes,
                                                        ref lstFooter,
                                                        ref lstMessages,
                                                        ref lstFilters);

                    #endregion
                }
                else
                {
                    #region - pagos -

                    // ##############################
                    // # SETUP LISTS ################
                    // ##############################

                    ArrayList lstHeader     = new ArrayList();
                    ArrayList lstContent    = new ArrayList();
                    ArrayList lstTableSizes = new ArrayList();
                    ArrayList lstFooter     = new ArrayList();
                    ArrayList lstMessages   = new ArrayList();
                    ArrayList lstFilters    = new ArrayList();

                    // ##############################
                    // # CUSTOMIZE
                    // ##############################

                    string output_st_total         = "";
                    string output_st_content_block = "";

                    int sel = i_Form.CboRelat.SelectedIndex;

                    string tg_type = "";
                    string st_rel  = "";

                    switch (sel)
                    {
                    case 1:         tg_type = TipoSitFat.EmCobrança;        st_rel = "Relatório de faturamento em cobrança";                                               break;

                    case 2:         tg_type = TipoSitFat.PagoDoc;           st_rel = "Relatório de faturamento pago com doc";                                              break;

                    case 3:         tg_type = TipoSitFat.PagoCC;            st_rel = "Relatório de faturamento pago em débito em conta";                   break;

                    case 4:         tg_type = TipoSitFat.BaixaCfeInst;      st_rel = "Relatório de faturamento baixado conforme instrução banco";  break;
                    }

                    dlgStatus stat = new dlgStatus("Relatório");

                    stat.LblActivity.Text = "Processando relatório no servidor";
                    stat.Show();
                    Application.DoEvents();

                    if (!var_exchange.fetch_relFat(var_util.GetDataBaseTimeFormat(ctrl_TxtDtIni.getTextBoxValue_Date()),
                                                   var_util.GetDataBaseTimeFormat(ctrl_TxtDtFim.getTextBoxValue_Date().AddDays(1)),
                                                   tg_type,
                                                   ref header,
                                                   ref output_st_total,
                                                   ref output_st_content_block))
                    {
                        stat.Close();
                        i_Form.BtnConfirmar.Enabled = true;
                        return(false);
                    }

                    stat.LblActivity.Text = "Buscando detalhes de faturamento";
                    Application.DoEvents();

                    ArrayList full_memory = new ArrayList();

                    ArrayList sortMem = new ArrayList();

                    while (output_st_content_block != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(output_st_content_block, "500",
                                                      ref output_st_content_block,
                                                      ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                Rel_FatCompleto tmp = new Rel_FatCompleto(tmp_memory[t] as DataPortable);

                                sortMem.Add(tmp.get_st_nome());

                                full_memory.Add(tmp);
                            }
                        }
                    }

                    sortMem.Sort();

                    stat.LblActivity.Text = "Gerando relatório para web";
                    Application.DoEvents();

                    stat.pgStatus.Maximum = full_memory.Count;
                    stat.pgStatus.Minimum = 0;

                    money money_helper = new money();

                    ArrayList lst_sub_tbl_head = new ArrayList();

                    lst_sub_tbl_head.Add("Empresa/Loja");
                    lst_sub_tbl_head.Add("Cobrança R$");
                    lst_sub_tbl_head.Add("Vencimento");
                    lst_sub_tbl_head.Add("Cód. Banco");
                    lst_sub_tbl_head.Add("Mensagem");
                    lst_sub_tbl_head.Add("Data Baixa");

                    lstHeader.Add(lst_sub_tbl_head);

                    // Sub-título
                    lstMessages.Add("");
                    lstTableSizes.Add(800);

                    ArrayList lst_lines = new ArrayList();

                    for (int g = 0; g < sortMem.Count; ++g)
                    {
                        stat.pgStatus.Value = g + 1;
                        Application.DoEvents();

                        for (int u = 0; u < full_memory.Count; ++u)
                        {
                            Rel_FatCompleto rel = full_memory [u] as Rel_FatCompleto;

                            if (rel.get_st_nome() != sortMem[g].ToString())
                            {
                                continue;
                            }

                            // Lista de items para uma linha
                            ArrayList lst_sub_content = new ArrayList();

                            lst_sub_content.Add(rel.get_st_nome());
                            lst_sub_content.Add(money_helper.formatToMoney(rel.get_vr_cobranca()));
                            lst_sub_content.Add(var_util.getDDMMYYYY_format(rel.get_dt_vencimento()).Substring(0, 10));

                            if (rel.get_dt_baixa() == "")
                            {
                                lst_sub_content.Add("-");
                                lst_sub_content.Add("-");
                                lst_sub_content.Add("-");
                            }
                            else
                            {
                                lst_sub_content.Add(rel.get_cod_retBanco());
                                lst_sub_content.Add(rel.get_st_msgBanco());
                                lst_sub_content.Add(var_util.getDDMMYYYY_format(rel.get_dt_baixa()).Substring(0, 10));
                            }

                            lst_lines.Add(lst_sub_content);

                            if (g == full_memory.Count - 1)
                            {
                                ArrayList lst_sub_foot = new ArrayList();

                                lst_sub_foot.Add("Total contabilizado no período: R$ " +
                                                 money_helper.formatToMoney(output_st_total));

                                lstFooter.Add(lst_sub_foot);
                            }
                        }
                    }

                    lstContent.Add(lst_lines);

                    stat.Close();
                    Application.DoEvents();

                    SyCrafReport relat = new SyCrafReport(st_rel,
                                                          "RFD",
                                                          "Lista completa de empresas e lojas",
                                                          ctrl_TxtDtIni.getTextBoxValue(),
                                                          ctrl_TxtDtFim.getTextBoxValue(),
                                                          ref lstHeader,
                                                          ref lstContent,
                                                          ref lstTableSizes,
                                                          ref lstFooter,
                                                          ref lstMessages,
                                                          ref lstFilters);
                    #endregion
                }

                i_Form.BtnConfirmar.Enabled = true;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
예제 #34
0
    public void BuscaDados(DateTime tim)
    {
        RptHist.Visible = false;

        GetConnection();

        string st_cartao = Session["st_cartao"].ToString();
        string st_senha  = Session["st_senha"].ToString();

        ArrayList lst    = new ArrayList();
        ArrayList lstEmp = new ArrayList();

        DadosCartaoEdu dce = new DadosCartaoEdu();

        money mon = new money();

        try
        {
            if (var_exchange.web_fetch_edu_virtual(st_cartao,
                                                   st_senha,
                                                   var_util.ConvertDate(tim),
                                                   ref dce,
                                                   ref lst,
                                                   ref lstEmp))
            {
                if (dce.get_nu_vrRank() != "0")
                {
                    LblAluno.Text = "#" + dce.get_nu_vrRank() + " - " + dce.get_st_aluno();
                }
                else
                {
                    LblAluno.Text = dce.get_st_aluno();
                }

                LblDiaMov.Text = tim.ToLongDateString();

                TxtVrDispVirtual.Text = mon.formatToMoney(dce.get_vr_disp_virtual());
                TxtVrTotalInv.Text    = mon.formatToMoney(dce.get_vr_invest_virtual());

                TxtVrTotal.Text = mon.setMoneyFormat(Convert.ToInt64(dce.get_vr_disp_virtual()) +
                                                     Convert.ToInt64(dce.get_vr_invest_virtual()));

                ArrayList values    = new ArrayList();
                ArrayList valuesEmp = new ArrayList();

                for (int t = 0; t < lstEmp.Count; ++t)
                {
                    DadosMovEmpresaVirtual    dMov = new DadosMovEmpresaVirtual(lstEmp[t] as DataPortable);
                    PositionData_FundoEmpresa bind = new PositionData_FundoEmpresa();

                    bind.nome        = dMov.get_st_nome();
                    bind.acoes       = dMov.get_vr_acoes();
                    bind.osc         = dMov.get_vr_osc();
                    bind.vrdia       = mon.formatToMoney(dMov.get_vr_dia());
                    bind.preco_medio = mon.formatToMoney(dMov.get_vr_preco_medio());

                    bind.invest = (Convert.ToInt64(dMov.get_vr_acoes()) * Convert.ToInt64(dMov.get_vr_dia())).ToString();
                    bind.invest = mon.formatToMoney(bind.invest);

                    bool neg = false;

                    if (bind.osc.IndexOf("-") >= 0)
                    {
                        neg = true;
                    }

                    bind.osc = bind.osc.Replace("-", "");
                    bind.osc = bind.osc.PadLeft(4, '0');

                    int len = bind.osc.Length;

                    if (len == 4)
                    {
                        bind.osc = "0," + bind.osc;
                    }
                    else
                    {
                        bind.osc = bind.osc.Insert(len - 4, ",");
                    }

                    if (neg)
                    {
                        bind.osc = "-" + bind.osc;
                    }

                    bind.osc += "%";

                    if (bind.osc == "0,0000%")
                    {
                        bind.osc = "-";
                    }

                    valuesEmp.Add(bind);
                }

                RptEmpresas.DataSource = valuesEmp;
                RptEmpresas.DataBind();

                RptEmpresas.Visible = true;

                for (int t = 0; t < lst.Count; ++t)
                {
                    DadosMovEmpresaVirtual dMov = new DadosMovEmpresaVirtual(lst[t] as DataPortable);
                    PositionData_MovFundo  bind = new PositionData_MovFundo();

                    bind.nome = dMov.get_st_nome();
                    bind.mov  = dMov.get_vr_mov_fundo();

                    if (bind.mov.IndexOf("-") == -1)
                    {
                        bind.mov = "+" + bind.mov;
                    }

                    bind.total = dMov.get_vr_total();

                    values.Add(bind);
                }

                RptExtrato.DataSource = values;
                RptExtrato.DataBind();

                RptExtrato.Visible = true;
            }

            var_exchange.m_Client.ExitSession();
        }
        catch (System.Exception se)
        {
            if (se.Message == "Exit")
            {
                Session["st_error"]      = "Esgotado tempo de espera no servidor";
                Session["st_error_dest"] = "default.aspx";
                Response.Redirect("error.aspx", true);
            }
        }
    }