public static List <Collection> GetNTORCollection(NameValueCollection querystring)
        {
            string criteria = querystring.Get("Criteria");
            int    branchID = int.TryParse(querystring.Get("BranchID"), out branchID) ? branchID : 0;

            return(CollectionDAL.GetNTORCollection(criteria, branchID));
        }
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void tsbtnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvClient.SelectedRows.Count > 0)
         {
             int ID = int.Parse(this.dgvClient.SelectedRows[0].Cells["Collection_ID"].Value.ToString());
             cid = ID;
             Expression <Func <View_Collection, bool> > funviewinto = n => n.Collection_ID == ID;
             foreach (var n in CollectionDAL.Query(funviewinto))
             {
                 if (n.Client_NAME != null)
                 {
                     this.txtCollectionName.Text = n.Collection_Name;
                 }
                 if (n.Client_Dictionary_ID > 0)
                 {
                     this.cmbClient.SelectedValue = n.Client_ID;
                 }
                 if (n.Client_REMARK != null)
                 {
                     this.txtRemark.Text = n.Collection_Remark;
                 }
                 break;
             }
             btnSave.Text = "修改";
         }
     }
     catch (Exception)
     {
     }
 }
        public static List <SearchSales> GetSalesForCollex(NameValueCollection querystring)
        {
            string criteria = querystring.Get("Criteria");
            int    branchID = int.TryParse(querystring.Get("BranchID"), out branchID) ? branchID : 0;

            return(CollectionDAL.GetSalesForCollex(criteria, branchID));
        }
        public static string ManageCollection(NameValueCollection querystring)
        {
            int      intParser;
            decimal  decimalParser;
            bool     boolParser;
            DateTime dateTimeParser;

            UserProfile userProfile = WebCommon.GetUserProfile();

            var collection = new Collection
            {
                CollectionID            = int.TryParse(querystring.Get("CollectionID"), out intParser) ? intParser : 0,
                BranchID                = int.TryParse(querystring.Get("BranchID"), out intParser) ? intParser : 0,
                PaymentTypeID           = int.TryParse(querystring.Get("PaymentTypeID"), out intParser) ? intParser : 0,
                Date                    = DateTime.TryParse(querystring.Get("Date"), out dateTimeParser) ? dateTimeParser.ToShortDateString() : "",
                ReferenceNumber         = querystring.Get("Number"),
                StubNumber              = int.TryParse(querystring.Get("StubNumberID"), out intParser) ? intParser : 0,
                SaleID                  = int.TryParse(querystring.Get("SaleID"), out intParser) ? intParser : 0,
                AccountCode             = querystring.Get("AccountCode"),
                PayeeID                 = int.TryParse(querystring.Get("PayeeID"), out intParser) ? intParser : 0,
                PayeeName               = querystring.Get("PayeeName"),
                CustomerBranchID        = int.TryParse(querystring.Get("CustomerBranchID"), out intParser) ? intParser : 0,
                GrossPaid               = decimal.TryParse(querystring.Get("GrossPaid"), out decimalParser) ? decimalParser : 0,
                RebateDiscount          = decimal.TryParse(querystring.Get("RebateDiscount"), out decimalParser) ? decimalParser : 0,
                PenaltyCharges          = decimal.TryParse(querystring.Get("PenaltyCharges"), out decimalParser) ? decimalParser : 0,
                Others                  = decimal.TryParse(querystring.Get("Others"), out decimalParser) ? decimalParser : 0,
                NetPay                  = querystring.Get("NetPay"),
                Remarks                 = querystring.Get("Remarks"),
                BankInvdSubsidiaryID    = int.TryParse(querystring.Get("BankInvdSubsidiaryID"), out intParser) ? intParser : 0,
                EmployeeSubsidiaryID    = int.TryParse(querystring.Get("EmployeeSubsidiaryID"), out intParser) ? intParser : 0,
                CustomerID              = int.TryParse(querystring.Get("CustomerID"), out intParser) ? intParser : 0,
                isDeposit               = bool.TryParse(querystring.Get("IsDeposit"), out boolParser) ? boolParser : false,
                UserID                  = userProfile.UserId,
                IDNtor                  = int.TryParse(querystring.Get("NtorID"), out intParser) ? intParser : 0,
                intIDMasEmployeeLiaison = int.TryParse(querystring.Get("intIDMasEmployeeLiaison"), out intParser) ? intParser : 0
            };

            intParser = int.TryParse(collection.ReferenceNumber, out intParser) ? intParser : -5;

            if (intParser == -5)
            {
                throw new Exception("Lacking Reference Number.");
            }

            if (collection.StubNumber == -5)
            {
                throw new Exception("Invalid Stub Number.");
            }

            if (string.IsNullOrEmpty(collection.Date))
            {
                throw new Exception("Invalid Date.");
            }

            string isInsert = querystring.Get("TransType");
            string param    = WebCommon.ToXML(collection);

            return(CollectionDAL.ManageCollection(param, isInsert));
        }
        public static string GetAcctBalance(NameValueCollection querystring)
        {
            string intBranchID = querystring.Get("BranchID");
            string dtasof      = querystring.Get("AsOf");
            string stracctcd   = querystring.Get("AcctCode");

            return(CollectionDAL.GetAcctBalance(intBranchID, dtasof, stracctcd));
        }
        public static List <UserTransaction> GetUserTransaction(NameValueCollection querystring)
        {
            UserProfile userProfile = WebCommon.GetUserProfile();
            string      datefrom    = querystring.Get("DateFrom");
            string      dateto      = querystring.Get("DateTo");
            int         userid      = userProfile.UserId;

            return(CollectionDAL.GetUserTransaction(userid, datefrom, dateto));
        }
        public static List <StubNumber> GetStubNumber(NameValueCollection querystring)
        {
            UserProfile userProf     = WebCommon.GetUserProfile();
            int         branchid     = int.TryParse(querystring.Get("BranchID"), out branchid) ? branchid : 0;
            int         paymentypeid = int.TryParse(querystring.Get("PaymentTypeID"), out paymentypeid) ? paymentypeid : 0;
            int         userID       = userProf.UserId;

            return(CollectionDAL.GetStubNumber(branchid, paymentypeid, userID));
        }
        public static string CheckModuleEncodingStatus(NameValueCollection querystring)
        {
            int      param;
            DateTime dat;

            int    branchID     = int.TryParse(querystring.Get("intIDMasLocation"), out param) ? param : 0;
            int    moduleID     = int.TryParse(querystring.Get("intIDMasModuleLocking"), out param) ? param : 0;
            string encodingDate = DateTime.TryParse(querystring.Get("datEncoding"), out dat) ? dat.ToShortDateString() : string.Empty;

            return(CollectionDAL.CheckModuleEncodingStatus(branchID, moduleID, encodingDate));
        }
Esempio n. 9
0
 public ICollection Get(string id)
 {
     try
     {
         using (var cmd = new DBCommand())
         {
             return(CollectionDAL.Get(cmd, id));
         }
     }
     catch (Exception ex)
     {
         using (var builder = new MessageBuilder())
         {
             string err = builder.AppendLine("读取付费信息错误!").AppendLine(ex).Message;
             throw new Exception(err);
         }
     }
 }
Esempio n. 10
0
 public ICollection Delete(ICollection instance)
 {
     using (var cmd = new DBCommand())
     {
         try
         {
             CollectionDAL.Delete(cmd, instance);
             cmd.Commit();
             return(instance);
         }
         catch (Exception ex)
         {
             cmd.RollBack();
             using (var builder = new MessageBuilder())
             {
                 string err = builder.AppendLine("删除付费信息错误!").AppendLine(ex).Message;
                 throw new Exception(err);
             }
         }
     }
 }
Esempio n. 11
0
 public ICollection Create(string id, decimal?value, decimal?offset)
 {
     using (var cmd = new DBCommand())
     {
         try
         {
             ICollection instance = CollectionDAL.Create(cmd, id, value, offset);
             cmd.Commit();
             return(instance);
         }
         catch (Exception ex)
         {
             cmd.RollBack();
             using (var builder = new MessageBuilder())
             {
                 string err = builder.AppendLine("创建付费信息错误!").AppendLine(ex).Message;
                 throw new Exception(err);
             }
         }
     }
 }
Esempio n. 12
0
 public bool IsExisting(string appId)
 {
     using (var cmd = new DBCommand())
     {
         try
         {
             var od = AppCore.AppSingleton.FindObjDef <CollectionObjDef>();
             return(CollectionDAL.IsExisting(cmd,
                                             new Dictionary <IAttributeDefinition, object>()
             {
                 { od.ID, appId }
             }));
         }
         catch (Exception ex)
         {
             using (var builder = new MessageBuilder())
             {
                 string err = builder.AppendLine("查找付款记录错误!").AppendLine(ex).Message;
                 throw new Exception(err);
             }
         }
     }
 }
Esempio n. 13
0
 // Gets collection data for a specific note.
 public Collection GetCollection(int NoteID)
 {
     return CollectionDAL.GetCollectionByNoteID(NoteID);
 }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            string name = txtCollectionName.Text.Trim();

            if (string.IsNullOrEmpty(name))
            {
                MessageBox.Show(this, "采集端名称不能为空");
                return;
            }
            if (cmbClient.SelectedIndex < 0)
            {
                MessageBox.Show(this, "请选择客户端");
                return;
            }
            if (btnSave.Text == "添加")
            {
                if (ClientDAL.ISClientInfoName(name))
                {
                    MessageBox.Show(this, "采集端名称已存在");
                    return;
                }
                int            id     = 0;
                CollectionInfo client = new CollectionInfo();
                client.Collection_Name      = name;
                client.Collection_Client_ID = Convert.ToInt32(cmbClient.SelectedValue);
                client.Collection_Remark    = txtRemark.Text.Trim();

                if (CollectionDAL.InsertOneQCRecord(client))
                {
                    MessageBox.Show("添加成功!");
                    Empty();
                }
                else
                {
                    MessageBox.Show("添加失败!");
                }
            }
            else
            {
                if (cid == 0)
                {
                    return;
                }
                object obj = LinQBaseDao.GetSingle("select count(0) from CollectionInfo where Collection_ID !=" + cid + " and Collection_Name='" + name + "'");
                if (Convert.ToInt32(obj.ToString()) > 0)
                {
                    MessageBox.Show(this, "采集端名称已存在");
                    return;
                }
                Expression <Func <CollectionInfo, bool> > exp = n => n.Collection_ID == cid;
                Action <CollectionInfo> ap = s =>
                {
                    s.Collection_Name      = name;
                    s.Collection_Client_ID = Convert.ToInt32(cmbClient.SelectedValue);
                    s.Collection_Remark    = txtRemark.Text.Trim();
                };
                CollectionDAL.Update(exp, ap);
                Empty();
            }
            LoadData("");
        }
        /*public static List<BorrowingORCRAmountDeposited> GetORCRAmountDeposited(NameValueCollection querystring)
         * {
         *  //int ID = int.TryParse(querystring.Get("ID"), out ID) ? ID : 0;
         *  return LTOBorrowing_ORCRRequestDAL.GetORCRAmountDeposited();
         * }*/

        public static List <PaymentType> GetPaymentType()
        {
            return(CollectionDAL.GetPaymentType());
        }
 public static List <BorrowingORCRAmountDeposited> GetORCRAmountDeposited(NameValueCollection querystring)
 {
     //int ID = int.TryParse(querystring.Get("ID"), out ID) ? ID : 0;
     return(CollectionDAL.GetORCRAmountDeposited());
 }
        public static List <BankSubsidiary> GetBankSubsidiary(NameValueCollection querystring)
        {
            int branchid = int.TryParse(querystring.Get("BranchID"), out branchid) ? branchid : 0;

            return(CollectionDAL.GetBankSubsidiary(branchid));
        }
 public static List <CollectionLiaison> GetCollectionLiaison()
 {
     return(CollectionDAL.GetCollectionLiaison());
 }