Exemple #1
0
        public static R Invoice(Invoice invoice)
        {
            var m = new R();
            try
            {
                SqlParameter[] param =
                {
                    new SqlParameter("@IID",invoice.IID),
                    new SqlParameter("@MID",invoice.MID),
                    new SqlParameter("@IDSN",invoice.IDSN),
                    new SqlParameter("@Name",invoice.Name),
                    new SqlParameter("@Amount",invoice.Amount),
                    new SqlParameter("@Title",invoice.Title),
                    new SqlParameter("@Tel",invoice.Tel),
                    new SqlParameter("@Province",invoice.Province),
                    new SqlParameter("@City",invoice.City),
                    new SqlParameter("@Address",invoice.Address),
                    new SqlParameter("@Zip",invoice.Zip)
                };
                param[0].Direction = ParameterDirection.InputOutput;
                var r = SqlHelper.ExecuteNonQuery(C.conn, CommandType.StoredProcedure, "M_Update_Invoice", param);
                m.Code = 0;
                m.Value = Convert.ToInt32(param[0].Value);
            }
            catch (Exception ex)
            {
                m.Code = 300;
                m.Message = ex.Message;
                log.Fatal(ex.Message);
                log.FatalException(ex.Message, ex);
            }

            return m;
        }
Exemple #2
0
 public ActionResult Invoice(Invoice invoice)
 {
     invoice.MID = Client.MID;
     invoice.IDSN = Client.IDSN;
     var r = DAL.Update.Invoice(invoice);
     return Json(r);
 }
Exemple #3
0
 public ActionResult Invoice(Invoice invoice)
 {
     var r = new R();
     var CashAmount = DAL.Get.AvailableInvoiceCash(Client.MID);
     if (CashAmount.DecimalValue >= invoice.Amount)
     {
         invoice.MID = Client.MID;
         invoice.IDSN = Client.IDSN;
         r = DAL.Update.Invoice(invoice);
     }
     else
     {
         r.Code = 101;
         r.Message = "申请金额超出可申请配额";
     }
     return Json(r);
 }
Exemple #4
0
 public ActionResult Invoice(Invoice invoice)
 {
     var r = DAL.M.Update.Invoice(invoice);
     return Json(r);
 }
Exemple #5
0
        public static Invoice Invoice(int MID,int IID)
        {
            var m = new Invoice();
            try
            {
                SqlParameter[] param =
                {
                    new SqlParameter("@MID",MID),
                    new SqlParameter("@IID",IID)
                };
                var dr = SqlHelper.ExecuteReader(C.conn, CommandType.StoredProcedure, "Get_Invoice", param);
                if (dr.Read())
                {
                    
                    m.MID = MID;
                    if (DBNull.Value != dr["IID"])
                        m.IID = Convert.ToInt32(dr["IID"]);
                    if (DBNull.Value != dr["IDSN"])
                        m.IDSN = Convert.ToString(dr["IDSN"]);
                    if (DBNull.Value != dr["Name"])
                        m.Name = Convert.ToString(dr["Name"]);
                    if (DBNull.Value != dr["Amount"])
                        m.Amount = Convert.ToDecimal(dr["Amount"]);
                    if (DBNull.Value != dr["Title"])
                        m.Title = Convert.ToString(dr["Title"]);
                    if (DBNull.Value != dr["Tel"])
                        m.Tel = Convert.ToString(dr["Tel"]);
                    if (DBNull.Value != dr["Province"])
                        m.Province = Convert.ToString(dr["Province"]);
                    if (DBNull.Value != dr["City"])
                        m.City = Convert.ToString(dr["City"]);
                    if (DBNull.Value != dr["Address"])
                        m.Address = Convert.ToString(dr["Address"]); ;
                    if (DBNull.Value != dr["Zip"])
                        m.Zip = Convert.ToString(dr["Zip"]);
                    if (DBNull.Value != dr["CreateDate"])
                        m.CreateDate = Convert.ToDateTime(dr["CreateDate"]);

                   
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                log.Fatal(ex.Message);
                log.Fatal(ex.StackTrace);
            }
            return m;
        }