Esempio n. 1
0
        private void cbBill_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbBill.Text.Length == 0)
            {
                return;
            }

            DataRow[] dr = dsTmp.Tables[0].Select("F_Class = '" + cbBill.Text + "'");
            if (dr.Length == 0)
            {
                return;
            }
            strMasterSQL = dr[0]["F_MasterSQL"].ToString();
            strSlaverSQL = dr[0]["F_SlaverSQL"].ToString();
            DataLib.DataHelper myHelper = new DataLib.DataHelper();

            if (strMasterSQL.Length > 0)
            {
                DataSet dsMaster;
                if (strValue == "")
                {
                    dsMaster = myHelper.GetOtherDs(strMasterSQL, GetParm2());
                }
                else
                {
                    dsMaster = myHelper.GetOtherDs(strMasterSQL, GetParm3());
                }

                gcMaster.DataSource = dsMaster.Tables[0].DefaultView;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        protected virtual int BindData()
        {
            if (strQuerySQL.Length == 0)
            {
                return(-1);
            }
            BaseClass.frmFlag myFlag = new BaseClass.frmFlag();
            myFlag.Show();
            myFlag.Update();
            try
            {
                try
                {
                    DataLib.DataHelper myHelper = new DataLib.DataHelper();
                    DataSet            ds;
                    if (cbCutOff.Visible == false)
                    {
                        ds = myHelper.GetOtherDs(strQuerySQL, GetParm3());
                    }
                    else
                    {
                        ds = myHelper.GetOtherDs(strQuerySQL, GetParm5());
                    }

                    if (ds == null)
                    {
                        return(-1);
                    }

                    int intRow = gvList.FocusedRowHandle;
                    gcList.DataSource = ds.Tables[0].DefaultView;
                    if (intRow <= gvList.RowCount)
                    {
                        gvList.FocusedRowHandle = intRow;
                    }
                    //AssignField();
                    DataLib.sysClass.LoadFormatFromDB(gvList, BillTag, cbType.SelectedIndex);

                    DataLib.SysVar.TestColumnRight(gvList, this.Name);
                    return(0);
                }
                catch (Exception E)
                {
                    MessageBox.Show(E.Message, "错误");
                    return(-1);
                }
            }
            finally
            {
                myFlag.Dispose();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        protected virtual int BindData()
        {
            if (strQuerySQL.Length == 0)
            {
                return(-1);
            }

            BaseClass.frmFlag myFlag = new BaseClass.frmFlag();
            myFlag.Show();
            myFlag.Update();

            try
            {
                try
                {
                    DataLib.DataHelper myHelper = new DataLib.DataHelper();
                    DataSet            ds;

                    if (rgOption.Visible == false)
                    {
                        ds = myHelper.GetOtherDs(strQuerySQL, GetParm());
                    }
                    else
                    {
                        ds = myHelper.GetOtherDs(strQuerySQL, GetParm1());
                    }

                    if (ds == null)
                    {
                        return(-1);
                    }
                    //gvReport.Columns.Clear();
                    gcReport.DataSource = ds.Tables[0].DefaultView;
                    //AssignField();
                    DataLib.sysClass.LoadFormatFromDB(gvReport, ReportTag, rgOption.SelectedIndex);
                    DataLib.SysVar.TestColumnRight(gvReport, this.Name);
                    return(0);
                }
                catch (Exception E)
                {
                    MessageBox.Show(E.Message, "错误");
                    return(-1);
                }
            }
            finally
            {
                myFlag.Dispose();
            }
        }
Esempio n. 4
0
        private void DataBind()
        {
            string strSQL = "";

            DataLib.DataHelper myHelper = new DataLib.DataHelper();
            strSQL = "select isnull(F_QcMoney,0) - isnull(F_QCHasMoney,0) as F_Money from t_Supplier where F_ID = '" + strValue + "'";
            DataSet ds = myHelper.GetDs(strSQL);

            if (Convert.ToDecimal(ds.Tables[0].Rows[0]["F_Money"]) > 0)
            {
                strSQL = "select '期初' as F_Tag,'期初' as F_BillID,'1900-1-1' as F_Date,F_QcMoney as F_TotalMoney,F_QCHasMoney as F_PayMoney,";
                strSQL = strSQL + "isnull(F_QcMoney,0) - isnull(F_QCHasMoney,0) as F_NoPay,Cast(0 as Bit) as F_Select from t_Supplier where F_ID = @Value and isnull(F_QcMoney,0) - isnull(F_QCHasMoney,0) > 0";
                strSQL = strSQL + " union all ";
            }
            else
            {
                strSQL = "";
            }

            strSQL = strSQL + "select '采购进货' as F_Tag,F_BillID,F_Date,isnull(F_Money,0)+isnull(F_OtherMoney,0) as F_TotalMoney,";
            strSQL = strSQL + "F_PayMoney,isnull(F_Money,0)+isnull(F_OtherMoney,0) - isnull(F_PayMoney,0) as F_NoPay,";
            strSQL = strSQL + "Cast(0 as Bit) as F_Select ";
            strSQL = strSQL + "from t_StockIn where F_Check = 1 and isnull(F_Money,0)+isnull(F_OtherMoney,0) - isnull(F_PayMoney,0) <> 0 ";
            strSQL = strSQL + "and F_PayDate >= @Start and F_PayDate <= @End and F_SupplierID = @Value";
            strSQL = strSQL + " union all ";
            strSQL = strSQL + "select '采购退货',F_BillID,F_Date,isnull(F_Money,0)+isnull(F_OtherMoney,0),";
            strSQL = strSQL + "F_PayMoney,isnull(F_Money,0)+isnull(F_OtherMoney,0) - isnull(F_PayMoney,0),";
            strSQL = strSQL + "Cast(0 as Bit) as F_Select ";
            strSQL = strSQL + "from t_StockBack where F_Check = 1 and isnull(F_Money,0)+isnull(F_OtherMoney,0) - isnull(F_PayMoney,0) <> 0 ";
            strSQL = strSQL + "and F_PayDate >= @Start and F_PayDate <= @End and F_SupplierID = @Value";
            strSQL = strSQL + " and F_Kind = '退款转应付款'";

            ds = myHelper.GetOtherDs(strSQL, GetParm3());
            gcMain.DataSource = ds.Tables[0].DefaultView;
        }
Esempio n. 5
0
        private DataSet GetQuery()
        {
            DataRow dr   = gridView1.GetDataRow(gridView1.FocusedRowHandle);
            string  sSQL = "select isnull(F_SQL,'') as F_SQL from t_ReportFormat where F_FormName = '" + sFormName + "' and F_ReportName = '" + dr["F_ReportName"].ToString() + "'";

            DataLib.DataHelper myHelper  = new DataLib.DataHelper();
            DataSet            ds        = myHelper.GetDs(sSQL);
            string             sPrintSQL = "";

            if (ds.Tables[0].Rows.Count > 0)
            {
                sPrintSQL = ds.Tables[0].Rows[0][0].ToString();
            }

            if (sPrintSQL == "")
            {
                MessageBox.Show(this, "选定报表还没设置相应的SQL语句,请先设置!", "提示");
                return(null);
            }

            Hashtable htParm = new Hashtable();

            htParm.Add("@Value", sBillID);
            DataSet dsResult = myHelper.GetOtherDs(sPrintSQL, htParm);

            return(dsResult);
        }
Esempio n. 6
0
 /// <summary>
 /// 数据绑定
 /// </summary>
 protected virtual void BindData()
 {
     if (strQuerySQL.Length == 0)
     {
         return;
     }
     BaseClass.frmFlag myFlag = new BaseClass.frmFlag();
     myFlag.Show();
     myFlag.Update();
     try
     {
         DataLib.DataHelper myHelper = new DataLib.DataHelper();
         DataSet            ds       = myHelper.GetOtherDs(strQuerySQL, GetParm());
         if (ds == null)
         {
             return;
         }
         int intRow = gvBase.FocusedRowHandle;
         gcBase.DataSource = ds.Tables[0].DefaultView;
         DataLib.SysVar.TestColumnRight(gvBase, this.Name);
         if (intRow <= gvBase.RowCount)
         {
             gvBase.FocusedRowHandle = intRow;
         }
     }
     finally
     {
         myFlag.Dispose();
     }
 }
Esempio n. 7
0
 /// <summary>
 /// 刷新相关单据
 /// </summary>
 private void RefreshSlaver()
 {
     if (strSlaverSQL.Length > 0)
     {
         DataLib.DataHelper myHelper = new DataLib.DataHelper();
         DataSet            dsSlaver = myHelper.GetOtherDs(strSlaverSQL, GetParm());
         gcSlaver.DataSource = dsSlaver.Tables[0].DefaultView;
     }
 }
Esempio n. 8
0
        private DataSet GetQuery(string sSQL)
        {
            Hashtable htParm = new Hashtable();

            htParm.Add("@Value", sBillID);
            DataLib.DataHelper myHelper = new DataLib.DataHelper();
            DataSet            ds       = myHelper.GetOtherDs(sSQL, htParm);

            return(ds);
        }
Esempio n. 9
0
        /// <summary>
        /// 刷新相关单据
        /// </summary>
        private void RefreshSlaver()
        {
            if (strSlaverSQL.Length > 0)
            {
                DataLib.DataHelper myHelper = new DataLib.DataHelper();
                DataSet            dsSlaver;
                if (blnFlag == false)
                {
                    dsSlaver = myHelper.GetOtherDs(strSlaverSQL, GetParm());
                }
                else
                {
                    dsSlaver = myHelper.GetOtherDs(strSlaverSQL, GetParmOther());
                }

                gvSlaver.Columns.Clear();
                gcSlaver.DataSource = dsSlaver.Tables[0].DefaultView;
                DataLib.sysClass.LoadFormatFromDB(gvSlaver, BillTag, 1);
            }
        }
Esempio n. 10
0
        private int DataBind()
        {
            DataLib.DataHelper myHelper = new DataLib.DataHelper();
            DataSet            ds       = myHelper.GetOtherDs(strQuerySQL, GetParm());

            if (ds == null)
            {
                return(-1);
            }
            gcReport.DataSource = ds.Tables[0].DefaultView;
            AssignField();
            return(0);
        }
Esempio n. 11
0
        private void DataBind()
        {
            string strSQL = "select F_BillID,F_Date,isnull(F_Money,0) as F_TotalMoney,";

            strSQL = strSQL + "F_PayMoney,isnull(F_Money,0) - isnull(F_PayMoney,0) as F_NoPay,";
            strSQL = strSQL + "Cast(0 as Bit) as F_Select ";
            strSQL = strSQL + "from t_OutBill where isnull(F_Money,0) - isnull(F_PayMoney,0) <> 0 ";
            strSQL = strSQL + "and F_Date >= @Start and F_Date <= @End and F_OutSupplierID = @Value";
            DataLib.DataHelper myHelper = new DataLib.DataHelper();
            DataSet            ds       = myHelper.GetOtherDs(strSQL, GetParm3());

            gcMain.DataSource = ds.Tables[0].DefaultView;
        }
Esempio n. 12
0
        protected override int BindData()
        {
            if (edSubject.GetValue() == null)
            {
                return(-1);
            }
            if (strQuerySQL.Length == 0)
            {
                return(-1);
            }

            BaseClass.frmFlag myFlag = new BaseClass.frmFlag();
            myFlag.Show();
            myFlag.Update();

            try
            {
                try
                {
                    DataLib.DataHelper myHelper = new DataLib.DataHelper();
                    DataSet            ds;

                    ds = myHelper.GetOtherDs(strQuerySQL, GetParm());


                    if (ds == null)
                    {
                        return(-1);
                    }
                    gvReport.Columns.Clear();
                    gcReport.DataSource = ds.Tables[0].DefaultView;

                    gvReport.Columns["F_Date"].Caption  = "ÈÕÆÚ";
                    gvReport.Columns["F_Key"].Caption   = "ƾ֤×Ö";
                    gvReport.Columns["F_Tag"].Caption   = "ÕªÒª";
                    gvReport.Columns["F_Money"].Caption = "ºÏ¼Æ";
                    //gvReport.Columns["F_Rest"].Caption = "Óà¶î";
                    //AssignField();
                    return(0);
                }
                catch (Exception E)
                {
                    MessageBox.Show(E.Message, "´íÎó");
                    return(-1);
                }
            }
            finally
            {
                myFlag.Dispose();
            }
        }
Esempio n. 13
0
        public override void BindData()
        {
            base.BindData();
            string strSQL = "";

            strSQL = "select a.*,b.F_Name as F_ItemName,b.F_Spec,b.F_Material,b.F_Brand,(select F_Name from t_Class where F_ID = b.F_Type) as F_Type ";
            strSQL = strSQL + "from t_OutBillItem a,t_Item b ";
            strSQL = strSQL + "where a.F_ItemID = b.F_ID ";
            strSQL = strSQL + "and F_BillID = @Value";

            DataLib.DataHelper myHelper = new DataLib.DataHelper();
            DataSet            dsItem   = myHelper.GetOtherDs(strSQL, GetParm());

            dsItem.Tables[0].TableNewRow   += new DataTableNewRowEventHandler(ItemSlaverNewRow);
            binItem.DataSource              = dsItem.Tables[0].DefaultView;
            gcItem.DataSource               = binItem;
            gvItem.OptionsBehavior.Editable = gvList.OptionsBehavior.Editable;
        }
Esempio n. 14
0
        /// <summary>
        /// 保存部门
        /// </summary>
        private DataSet SaveDept(DataSet dsMaster, DataSet dsSlaver, DataSet dsUpdateSlaver, ref string strDeptSQL)
        {
            gvDept.PostEditor();
            binDept.EndEdit();
            DataLib.DataHelper myHelper = new DataLib.DataHelper();
            strDeptSQL = "select * from t_TaskDept where F_BillID = @Value";
            DataSet dsUpdateDept = myHelper.GetOtherDs(strDeptSQL, GetParm());

            foreach (DataRow dr in dsUpdateDept.Tables[0].Rows)
            {
                dr.Delete();
            }

            DataSet dsDept = ((DataView)binDept.DataSource).Table.DataSet;

            DataTable dt = dsDept.Tables[0];

            dt.AcceptChanges();
            foreach (DataRow dr in dt.Rows)
            {
                DataRow drNew  = dsUpdateDept.Tables[0].NewRow();
                int     intCnt = dt.Columns.Count;
                for (int i = 0; i < intCnt; i++)
                {
                    if (dt.Columns[i].ColumnName == "F_BillID")
                    {
                        drNew["F_BillID"] = dsMaster.Tables[0].Rows[0]["F_BillID"].ToString();
                    }
                    else
                    {
                        if (dsUpdateDept.Tables[0].Columns.IndexOf(dt.Columns[i].ColumnName) > 0)
                        {
                            drNew[dt.Columns[i].ColumnName] = dr[dt.Columns[i].ColumnName];
                        }
                    }
                }

                dsUpdateDept.Tables[0].Rows.Add(drNew);
            }
            return(dsUpdateDept);
        }
Esempio n. 15
0
        public override void BindData()
        {
            base.BindData();
            lbDept.DataBindings.Clear();
            lbDept.DataBindings.Add("Text", binMaster, "F_Dept");

            string strSQL = "";

            strSQL = "select * from t_TaskDept where F_BillID = @Value";

            DataLib.DataHelper myHelper = new DataLib.DataHelper();
            DataSet            dsDept   = myHelper.GetOtherDs(strSQL, GetParm());

            dsDept.Tables[0].TableNewRow += new DataTableNewRowEventHandler(ItemDeptNewRow);
            dsDept.Tables[0].RowDeleted  += new DataRowChangeEventHandler(ItemDeptDelRow);
            binDept.DataSource            = dsDept.Tables[0].DefaultView;

            strSQL = "select a.*,b.F_Name as F_ItemName,b.F_Spec ";
            strSQL = strSQL + "from t_TaskHalf a,t_Item b ";
            strSQL = strSQL + "where a.F_ItemID = b.F_ID ";
            strSQL = strSQL + "and F_BillID = @Value";

            DataSet dsHalf = myHelper.GetOtherDs(strSQL, GetParm());

            dsHalf.Tables[0].TableNewRow += new DataTableNewRowEventHandler(ItemSlaverNewRow1);
            binHalf.DataSource            = dsHalf.Tables[0].DefaultView;
            //DataLib.sysClass.LoadFormatFromDB(gvHalf, this.Name, 1);
            //this.AssignField("1",gvHalf);

            /*
             * ds.Tables[0].TableNewRow += new DataTableNewRowEventHandler(SlaverNewRow);
             * ds.Tables[0].ColumnChanging += new DataColumnChangeEventHandler(ColumnChanging);
             * ds.Tables[0].ColumnChanged += new DataColumnChangeEventHandler(ColumnChanged);
             */

            strSQL = "select a.*,b.F_Name as F_ItemName,b.F_Spec ";
            strSQL = strSQL + "from t_TaskItem a,t_Item b ";
            strSQL = strSQL + "where a.F_ItemID = b.F_ID ";
            strSQL = strSQL + "and F_BillID = @Value";

            DataSet dsItem = myHelper.GetOtherDs(strSQL, GetParm());

            binItem.DataSource            = dsItem.Tables[0].DefaultView;
            dsItem.Tables[0].TableNewRow += new DataTableNewRowEventHandler(ItemSlaverNewRow2);
            //DataLib.sysClass.LoadFormatFromDB(gvItem, this.Name, 2);
            //this.AssignField("2",gvItem);

            /*
             * ds.Tables[0].TableNewRow += new DataTableNewRowEventHandler(SlaverNewRow);
             * ds.Tables[0].ColumnChanging += new DataColumnChangeEventHandler(ColumnChanging);
             * ds.Tables[0].ColumnChanged += new DataColumnChangeEventHandler(ColumnChanged);
             */

            DataSet dsDropDept = myHelper.GetDs("select F_ID,F_Name from t_Class where F_ID like '03.%'");

            this.lupDept.DataSource    = dsDropDept.Tables[0].DefaultView;
            this.lupDept.DisplayMember = "F_Name";
            this.lupDept.ValueMember   = "F_ID";

            FocusedRowChanged(null, null);
        }
Esempio n. 16
0
        private void cbBill_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbBill.Text.Length == 0)
            {
                return;
            }
            BillTag = strBillType + cbBill.Text;
            DataRow[] dr = dsTmp.Tables[0].Select("F_Class = '" + cbBill.Text + "'");
            if (dr.Length == 0)
            {
                return;
            }
            strMasterSQL = dr[0]["F_MasterSQL"].ToString();
            strSlaverSQL = dr[0]["F_SlaverSQL"].ToString();
            DataLib.DataHelper myHelper = new DataLib.DataHelper();

            if (strMasterSQL.Length > 0)
            {
                DataSet dsMaster;
                if (strValue != "")
                {
                    dsMaster = myHelper.GetOtherDs(strMasterSQL, GetParm3());
                }
                else
                {
                    if (blnFlag == true)
                    {
                        dsMaster = myHelper.GetOtherDs(strMasterSQL, GetParm2());
                    }
                    else
                    {
                        dsMaster = myHelper.GetOtherDs(strMasterSQL, GetParm3());
                    }
                }

                //if ( blnFlag == false)
                //    dsMaster = myHelper.GetOtherDs(strMasterSQL, GetParm2());
                //else
                //{
                //    if (blnFlag == true)
                //        dsMaster = myHelper.GetOtherDs(strMasterSQL, GetParm2());
                //    else
                //        dsMaster = myHelper.GetOtherDs(strMasterSQL, GetParm3());
                //}

                gvMaster.Columns.Clear();

                gcMaster.DataSource = dsMaster.Tables[0].DefaultView;

                //if (dsMaster.Tables[0].Rows.Count > 0)
                //{
                RefreshSlaver();
                //}

                DataLib.sysClass.LoadFormatFromDB(gvMaster, BillTag, 0);
                DataLib.sysClass.LoadFormatFromDB(gvSlaver, BillTag, 1);

                DataTable dtSlaver = ((DataView)gcSlaver.DataSource).Table;
                if (dtSlaver.Columns.Contains("F_Select") == true)
                {
                    gvSlaver.Columns["F_Select"].OptionsColumn.AllowFocus = true;
                    gvSlaver.Columns["F_Select"].OptionsColumn.AllowEdit  = true;
                }

                //AssignField();
                //AssignField1();
            }
        }
Esempio n. 17
0
        protected override bool Save(DataSet dsMaster, DataSet dsSlaver, DataSet dsUpdateSlaver)
        {
            //return base.Save(dsMaster, dsSlaver, dsUpdateSlaver);
            DataLib.DataHelper myHelper     = new DataLib.DataHelper();
            string             strItemSQL   = "select * from t_OutBillItem where F_BillID = @Value";
            DataSet            dsUpdateItem = myHelper.GetOtherDs(strItemSQL, GetParm());

            foreach (DataRow dr in dsUpdateItem.Tables[0].Rows)
            {
                dr.Delete();
            }

            DataSet dsItem = ((DataView)binItem.DataSource).Table.DataSet;

            DataTable dt = dsItem.Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                DataRow drNew  = dsUpdateItem.Tables[0].NewRow();
                int     intCnt = dt.Columns.Count;
                for (int i = 0; i < intCnt; i++)
                {
                    if (dt.Columns[i].ColumnName == "F_BillID")
                    {
                        drNew["F_BillID"] = dsMaster.Tables[0].Rows[0]["F_BillID"].ToString();
                    }
                    else
                    {
                        if (dsUpdateItem.Tables[0].Columns.IndexOf(dt.Columns[i].ColumnName) > 0)
                        {
                            drNew[dt.Columns[i].ColumnName] = dr[dt.Columns[i].ColumnName];
                        }
                    }
                }

                dsUpdateItem.Tables[0].Rows.Add(drNew);
            }


            DataSet[] dsData = new DataSet[3];
            dsData[0] = dsMaster;
            dsData[1] = dsUpdateSlaver;
            dsData[2] = dsUpdateItem;

            string[] strSQL = new string[3];
            strSQL[0] = strMasterSQL;
            strSQL[1] = strSaveSlaverSQL;
            strSQL[2] = strItemSQL;


            if (myHelper.SaveMuteData1(dsData, strSQL, GetParm()).Length == 0)
            {
                MessageBox.Show("数据保存成功!!", "提示");
                strBillID = editControl1.GetValue().ToString();
                dsMaster.AcceptChanges();
                dsSlaver.AcceptChanges();
                dsItem.AcceptChanges();
                SetStatus(2);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 18
0
        /// <summary>
        /// 保存
        /// </summary>
        private bool SaveBill()
        {
            int intCnt = 0;

            gvMain.UpdateSummary();
            if (SavePre() == false)
            {
                return(false);
            }

            DataLib.DataHelper myHelper = new DataLib.DataHelper();
            binSlaver.EndEdit();
            binMaster.EndEdit();

            DataSet dsMaster = ((DataView)binMaster.DataSource).Table.DataSet;
            DataSet dsSlaver = ((DataView)binSlaver.DataSource).Table.DataSet;

            if (decID == 0)
            {
                decID = GetMaxID();
                dsMaster.Tables[0].Rows[0].BeginEdit();
                dsMaster.Tables[0].Rows[0]["F_ID"] = decID;
                dsMaster.Tables[0].Rows[0].EndEdit();
            }
            binSlaver.EndEdit();
            binMaster.EndEdit();


            DataSet dsUpdateSlaver = myHelper.GetOtherDs(strSaveSlaverSQL, GetParm());


            foreach (DataRow dr in dsUpdateSlaver.Tables[0].Rows)
            {
                dr.Delete();
            }

            DataTable dt = dsSlaver.Tables[0];

            dt.AcceptChanges();

            foreach (DataRow dr in dt.Rows)
            {
                if (dr.RowState == DataRowState.Deleted)
                {
                    continue;
                }
                string sID = dr["F_Subject"] == DBNull.Value ? "" :dr["F_Subject"].ToString();
                if (sID == "")
                {
                    continue;
                }
                DataRow drNew = dsUpdateSlaver.Tables[0].NewRow();
                intCnt = dt.Columns.Count;
                for (int i = 0; i < intCnt; i++)
                {
                    if (dt.Columns[i].ColumnName == "F_ID")
                    {
                        drNew["F_ID"] = dsMaster.Tables[0].Rows[0]["F_ID"];
                    }
                    else
                    {
                        if (dsUpdateSlaver.Tables[0].Columns.IndexOf(dt.Columns[i].ColumnName) > 0)
                        {
                            drNew[dt.Columns[i].ColumnName] = dr[dt.Columns[i].ColumnName];
                        }
                    }
                }

                dsUpdateSlaver.Tables[0].Rows.Add(drNew);
            }

            return(Save(dsMaster, dsSlaver, dsUpdateSlaver));
        }