예제 #1
0
        /// <summary>
        /// 保存收款数据
        /// </summary>
        public void SaveDataSet()
        {
            DataTable tbm = this.TW_PaymentMain.GetChanges();

            if (tbm != null)
            {
                tbm.TableName = "TW_PaymentMain";
            }


            DataTable tb1 = TW_Payment.GetChanges();

            if (tb1 != null)
            {
                tb1.TableName = "TW_Payment";
            }

            DataTable tb2 = TW_PaymentDetail.GetChanges();

            if (tb2 != null)
            {
                tb2.TableName = "TW_PaymentDetail";
            }


            DataSet dst = new DataSet();

            if (tbm != null)
            {
                dst.Tables.Add(tbm);
            }
            if (tb1 != null)
            {
                dst.Tables.Add(tb1);
            }
            if (tb2 != null)
            {
                dst.Tables.Add(tb2);
            }
            //dst.Tables[0].GetChanges(DataRowState.)
            DBHelper.BasicSer.SaveDataSet(dst);
        }
예제 #2
0
        /// <summary>
        /// 选择付款明细
        /// </summary>
        /// <param name="zclx">注册类型</param>
        /// <param name="mainID">付款ID</param>
        public void ImpPaymentDetail(string mainID, out string zclx)
        {
            foreach (DataRow row in VW_PaymentDetail.Rows)
            {
                var newRow = TW_PaymentDetail.NewTW_PaymentDetailRow();
                newRow.TW_BusinessRegID   = row["TW_BusinessRegID"].ToString();
                newRow.TW_PaymentDetailID = Guid.NewGuid().ToString();
                newRow.业务员          = row["业务员"].ToString();
                newRow.业务员ID        = row["业务员ID"].ToString();
                newRow.注册员          = row["注册员"].ToString();
                newRow.注册员ID        = row["注册员ID"].ToString();
                newRow.做账会计         = row["做账会计"].ToString();
                newRow.做账会计ID       = row["做账会计ID"].ToString();
                newRow.客户名称         = row["公司预核名称"].ToString();
                newRow.客户名称ID       = row["TW_BusinessRegID"].ToString();
                newRow.注册费          = decimal.Parse(row["注册费未收款"].ToString());
                newRow.工本费          = decimal.Parse(row["工本费未收款"].ToString());
                newRow.开票费          = decimal.Parse(row["开票费未收款"].ToString());
                newRow.月做账费         = decimal.Parse(row["月做账费"].ToString());
                newRow.收款日期         = DateTime.Now;
                newRow.TW_PaymentID = mainID;
                TW_PaymentDetail.Rows.Add(newRow);
            }
            if (VW_PaymentDetail.Rows.Count == 1 && TW_Payment.Rows.Count == 1)
            {
                string payCompany   = VW_PaymentDetail.Rows[0]["公司预核名称"].ToString();
                string payCompanyID = VW_PaymentDetail.Rows[0]["TW_BusinessRegID"].ToString();
                zclx = VW_PaymentDetail.Rows[0]["注册类型"].ToString();
                DataRow detailRow = VW_PaymentDetail.Rows[0];

                TW_PaymentRow mainRow = this.TW_Payment.Rows[0] as TW_PaymentRow;
                mainRow.BeginEdit();
                mainRow["支付单位"]   = payCompany;
                mainRow["客户名称ID"] = payCompanyID;
                mainRow.业务员       = detailRow["业务员"].ToString();
                mainRow.业务员ID     = detailRow["业务员ID"].ToString();
                mainRow.注册员       = detailRow["注册员"].ToString();
                mainRow.注册员ID     = detailRow["注册员ID"].ToString();
                mainRow.做账会计      = detailRow["做账会计"].ToString();
                mainRow.做账会计ID    = detailRow["做账会计ID"].ToString();
                switch (zclx)
                {
                case "成长版":
                    mainRow["收款类别"] = "成长版收款";
                    break;

                case "验资":
                case "审计":
                case "商标":
                    mainRow["收款类别"] = "其他一次性业务收款";
                    break;

                default:
                    mainRow["收款类别"] = "注册收款";
                    break;
                }


                mainRow.EndEdit();
            }
            else
            {
                zclx = "其他";
            }
        }