示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MessageID = Request["MessageID"] + "";
            //MessageID = "d0235c96-6473-4ed0-a34d-c156fba9b115";
            SystemCode = Request["SystemCode"] + "";
            //SystemCode = "OA";
            PERSONALRECORDID = Request["PERSONALRECORDID"] + "";

            string xml = Get_Record_DetailByForm(SystemCode + "_" + MessageID);
            //string xml = MobileService.Get_Record_DetailByForm(PERSONALRECORDID);

            ObjBill  bill     = null;
            BillView billView = new BillView();

            if (null != xml && xml.Length > 0)
            {
                try
                {
                    bill = billView.CreateView(this.pnl1, xml, IsApproval, ref error);
                    if (bill != null)
                    {
                        billText = bill.Text;
                    }
                }
                catch
                {
                    Response.Write(error);
                }
            }
            else
            {
                Response.Write("对不起,当前数据版本不对,请在电脑上查看");
            }
        }
示例#2
0
        public async Task <IActionResult> DetailsBill(int id)
        {
            var user = HttpContext.Session.GetString("Id");

            if (user == null || user == "")
            {
                return(NotFound());
            }
            var bill = await _context.Bill.FindAsync(id);

            if (bill == null)
            {
                return(NotFound());
            }

            string[] product  = bill.Items.Split(new char[] { ';' });
            string[] quantity = bill.Quantity.Split(new char[] { ';' });
            string[] price    = bill.Price.Split(new char[] { ';' });

            List <BillItem> billItems = new List <BillItem>();

            for (int i = 0; i < product.Length; i++)
            {
                BillItem billItem = new BillItem()
                {
                    Name     = product[i],
                    Quantity = int.Parse(quantity[i]),
                    Price    = int.Parse(price[i])
                };
                billItems.Add(billItem);
            }


            BillView model = new BillView()
            {
                Id            = bill.Id,
                User          = bill.User,
                Name          = bill.Name,
                Phone         = bill.Phone,
                Email         = bill.Email,
                Address       = bill.Address,
                Note          = bill.Note,
                Time          = bill.Time,
                Code          = bill.Code,
                PaymentMethod = bill.PaymentMethod,
                Status        = bill.Status,
                Items         = billItems,
                Discount      = bill.Discount,
                Ship          = bill.Ship,
                Total         = bill.Total
            };

            return(View(model));
        }
示例#3
0
 public static Bill ConvertToBill(this BillView billview)
 {
     return(new Bill
     {
         Id = int.Parse(billview.Id),
         SIMId = int.Parse(billview.SIMId),
         BillDate = DateTime.Parse(billview.BillDate),
         PayDate = DateTime.Parse(billview.PayDate),
         Value = int.Parse(billview.Value)
     });
 }
示例#4
0
文件: GetForm.cs 项目: jjg0519/OA
        public void GetForm(string MessageID, ref Panel panel, bool IsApproval, ref string error)
        {
            string        xml           = T_Bill_GetDetailByForm(MessageID);
            StringBuilder stringBuilder = new StringBuilder();
            BillView      billView      = new BillView();
            ObjBill       bill          = null;

            if (null != xml && xml.Length > 0)
            {
                bill = billView.CreateView(panel, xml, IsApproval, ref error);
            }
        }
示例#5
0
        public async void ShowBillView(int id, int politicianid)
        {
            webView.EvaluateJavascript("$.mobile.loading( 'show', {\n  text: 'Loading Related Bill ...',\n  " +
                                       "textVisible: 'false',\n  theme: 'b',\n  textonly: 'false' });");

            var bill = await WebAccess.GetBillAsync(id);

            bill.PoliticianId = politicianid;

            var template = new BillView {
                Model = bill
            };
            var page = template.GenerateString();

            webView.LoadHtmlString(page);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            con.ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=D:\\Projects\\c# assignments\\Hotel Manager\\Hotel\\database\\master.mdf;Integrated Security=True;User Instance=True";
            con.Open();
            int rno = Int32.Parse(txtRoom.Text);

            cmd.Connection = con;     // This solves the problem you see
            // HERE you SHOULD use a SQL paramter instead of appending strings to build your SQL !!!
            cmd.CommandText = "SELECT SUM(ItemRate) FROM logs WHERE RoomNo=" + rno + "";
            int amt = (int)cmd.ExecuteScalar();       //arror is at this part


            // HERE you SHOULD use a SQL paramter instead of appending strings to build your SQL !!!
            // Another point: you build an INSERT but never execute it ?!?
            cmd.CommandText = "INSERT INTO bill VALUES('" + txtBillNo.Text.ToString() + "','" + txtRoom.Text.ToString() + "','" + amt.ToString() + "')";
            con.Close();
            txtBillNo.Text = "";
            txtRoom.Text   = "";
            BillView bv = new BillView();

            bv.ShowDialog();
        }
示例#7
0
 public MenuPage(RestService restService)
 {
     this.restService = restService;
     billView         = new BillView(restService);
 }