///<summary> ///删除数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void DeleteBill(string materialMRPPlanGuid) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //保存单据主表数据 //先删除主表数据 string strDeleteSql = "Delete from MaterialMRPPlan where MaterialMRPPlanGuid='" + materialMRPPlanGuid + "'"; pComm.Execute(strDeleteSql); //删除明细表 strDeleteSql = "Delete from MaterialMRPPlanDetail where MaterialMRPPlanGuid='" + materialMRPPlanGuid + "'"; pComm.Execute(strDeleteSql); //删除明细表 strDeleteSql = "Delete from MaterialMRPPlanCalcSum where MaterialMRPPlanGuid='" + materialMRPPlanGuid + "'"; pComm.Execute(strDeleteSql); pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
///<summary> ///删除数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void DeleteBill(string HalfGoodsguid) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //保存单据主表数据 //先删除主表数据 string strDeleteSql = "Delete from HalfGoods where HalfGoodsGuid='" + HalfGoodsguid + "'"; pComm.Execute(strDeleteSql); //删除明细表 strDeleteSql = "Delete from HalfGoodsDetail where HalfGoodsGuid='" + HalfGoodsguid + "'"; pComm.Execute(strDeleteSql); pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
///<summary> ///删除数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void DeleteBill(string IncomeOrderGuid) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //保存单据主表数据 //先删除主表数据 string strDeleteSql = "Delete from IncomeOrder where IncomeOrderGuid='" + IncomeOrderGuid + "'"; pComm.Execute(strDeleteSql); //删除明细表1 strDeleteSql = "Delete from IncomeOrderDetail1 where IncomeOrderGuid='" + IncomeOrderGuid + "'"; pComm.Execute(strDeleteSql); //删除明细表2 strDeleteSql = "Delete from IncomeOrderDetail2 where IncomeOrderGuid='" + IncomeOrderGuid + "'"; pComm.Execute(strDeleteSql); pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
/// <summary> /// 删除 /// </summary> /// <returns></returns> public void DeleteCheckBill(string CheckBillGuid) { CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql); try { pObj_Comm.BeginTrans(); //删除主表 string ps_Sql = "delete from CheckBill where CheckBillGuid='" + CheckBillGuid + "'"; pObj_Comm.Execute(ps_Sql); //删除明细表 ps_Sql = "delete from CheckBillDetail where CheckBillGuid='" + CheckBillGuid + "'"; pObj_Comm.Execute(ps_Sql); pObj_Comm.CommitTrans(); pObj_Comm.Close(); } catch (Exception e) { pObj_Comm.RollbackTrans(); pObj_Comm.Close(); throw e; } }
///<summary> ///删除数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void InsertData(List <StockYJ> lstStockYJ) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //先删除 for (int i = 0; i < lstStockYJ.Count; i++) { string strDeleteSql = "Delete from StockYJ where MaterialGuid='" + lstStockYJ[i].MaterialGuid + "'"; pComm.Execute(strDeleteSql); } //后插入 for (int i = 0; i < lstStockYJ.Count; i++) { pComm.Execute(GetInsertSQL(lstStockYJ[i])); } pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
///<summary> ///删除数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void DeleteFileData(string FileGuID) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //保存单据主表数据 //先删除主表数据 string strDeleteSql = "Delete from FileData where FileGuID='" + FileGuID + "'"; pComm.Execute(strDeleteSql); //删除明细附件表 strDeleteSql = "Delete from FileDataAttachment where FileGuID='" + FileGuID + "'"; pComm.Execute(strDeleteSql); pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
///<summary> /// 删除数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void DetailMaterialBom(string strMaterialFatherGuid) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //删除集合中的bom子件数据 string strDeleteSql = ""; strDeleteSql = "Delete from MaterialBomDetail where MaterialFatherGuid='" + strMaterialFatherGuid + "'"; pComm.Execute(strDeleteSql); //删除集合中的bom母件数据 strDeleteSql = ""; strDeleteSql = "Delete from MaterialBom where MaterialGuid='" + strMaterialFatherGuid + "' "; pComm.Execute(strDeleteSql); pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add() { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into LOGINUSER("); strSql.Append("USERID,USERNAME,EMAIL,PASSWORD"); strSql.Append(")"); strSql.Append(" values ("); strSql.Append("'" + USERID + "',"); strSql.Append("'" + USERNAME + "',"); strSql.Append("'" + EMAIL + "',"); strSql.Append("'" + PASSWORD + "'"); strSql.Append(")"); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.Execute(strSql.ToString());//执行Sql语句无返回值 string strsql = "insert into UserRight(UserID,ckdmxb,ckdhzb,dbdgl,dbdxz,dbzsh,cccx,cksfmxb,bmsfmxb,sfchzb,sflxhzb,lkdgl,chmxz,kcpd,kcpdxz,kcpdsh,hp,ck,kh,gys,yg,bm,lkdxz,yhgl,qxgl,lkdsh,lkdmxb,lkdhzb,ckdgl,ckdxz,ckdsh) " + " values('" + USERID + "','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0')"; pComm.Execute(strsql);//执行Sql语句无返回值 pComm.Close(); return(true); } catch (System.Exception e) { pComm.Close(); throw e; } }
/// <summary> /// 删除文件 /// </summary> /// <param name="FileTypeID"></param> /// <returns></returns> public void DeleteFile(string FileGuID) { string ps_Sql = ""; DataTable pDTMain = new DataTable(); CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql); pObj_Comm.BeginTrans(); try { ps_Sql = " delete from FileData where FileGuID='" + FileGuID + "'"; pObj_Comm.Execute(ps_Sql); ps_Sql = " delete from FileDataAttachment where FileGuID='" + FileGuID + "'"; pObj_Comm.Execute(ps_Sql); pObj_Comm.CommitTrans(); pObj_Comm.Close(); } catch (Exception e) { pObj_Comm.RollbackTrans(); pObj_Comm.Close(); throw e; } }
///<summary> /// 保存用户属于那个权限组 /// </summary> /// <param name="tableid">SQL查询条件</param> /// <returns>存放查询结果的DataTable</returns> public void SaveUserRightGroup(List <string> lstUser, List <string> lstgroup) { string StrSQL = ""; CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); for (int i = 0; i < lstUser.Count; i++) { //先删除此用户原来属于的权限组 StrSQL = "delete from UserRightGroup where UserID='" + lstUser[i] + "'"; pComm.Execute(StrSQL); //再添加此用户的权限组 for (int j = 0; j < lstgroup.Count; j++) { StrSQL = " insert into UserRightGroup(UserID,GroupID) values('" + lstUser[i] + "','" + lstgroup [j] + "')"; pComm.Execute(StrSQL); } } pComm.CommitTrans(); pComm.Close(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
///<summary> ///删除数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void DeleteBill(string FileApplyguid) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //保存单据主表数据 //先删除主表数据 string strDeleteSql = "Delete from FileApply where FileApplyGuid='" + FileApplyguid + "'"; pComm.Execute(strDeleteSql); //删除明细表 strDeleteSql = "Delete from FileApplyDetail where FileApplyGuid='" + FileApplyguid + "'"; pComm.Execute(strDeleteSql); //删除申请人明细表 strDeleteSql = "Delete from FileApplyPersonDetail where FileApplyGuid='" + FileApplyguid + "'"; pComm.Execute(strDeleteSql); pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
/// <summary> /// 排序-向上,1--上移 2-下移 /// </summary> /// <returns>pDTMain 字段信息集</returns> public void SetOrderNo_Down(string InterID) { string ps_Sql = ""; DataTable pDTMain = new DataTable(); CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql); try { //得到当前结点的父结点 ps_Sql = "select OrderNo,FatherID from FileClass where InterID='" + InterID + "'"; pDTMain = pObj_Comm.ExeForDtl(ps_Sql); string Old_OrderNo = pDTMain.Rows[0]["OrderNo"].ToString(); string FatherID = pDTMain.Rows[0]["FatherID"].ToString(); //得到当前结点父结点下的所有子结点,也就是同级结点 ps_Sql = "select InterID,OrderNo from FileClass where FatherID='" + FatherID + "' order by OrderNo"; pDTMain = pObj_Comm.ExeForDtl(ps_Sql); string OrderNo2 = ""; string InterID2 = ""; int k = 0; for (int i = pDTMain.Rows.Count - 1; i >= 0; i--) { //找到了当前的结点 if (pDTMain.Rows[i]["OrderNo"].ToString() == Old_OrderNo) { if (i != pDTMain.Rows.Count - 1) { //将找到的两个类别的OrderNo互换 //将当前这个结点更新为上一个结点的OrderNo ps_Sql = "Update FileClass set OrderNo=" + OrderNo2 + " where InterID='" + InterID + "'"; pObj_Comm.Execute(ps_Sql); //更新上一个结点的OrderNo为本结点的 ps_Sql = "Update FileClass set OrderNo=" + Old_OrderNo + " where InterID='" + InterID2 + "'"; pObj_Comm.Execute(ps_Sql); break; } } k = i; OrderNo2 = pDTMain.Rows[k]["OrderNo"].ToString(); InterID2 = pDTMain.Rows[k]["InterID"].ToString(); } pObj_Comm.Close(); } catch (Exception e) { pObj_Comm.Close(); throw e; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add() { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [BasicData]("); strSql.Append("UnitName,flag"); strSql.Append(")"); strSql.Append(" values ("); strSql.Append("'" + UnitName + "',"); strSql.Append("" + flag + ""); strSql.Append(")"); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.Execute(strSql.ToString());//执行Sql语句无返回值 pComm.Close(); return(true); } catch (System.Exception e) { pComm.Close(); throw e; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update() { StringBuilder strSql = new StringBuilder(); strSql.Append("update Material set "); strSql.Append("MaterialID='" + MaterialID + "',"); strSql.Append("MaterialName='" + MaterialName + "',"); strSql.Append("ClassId='" + ClassId + "',"); strSql.Append("Unit='" + Unit + "',"); strSql.Append("Spec='" + Spec + "',"); strSql.Append("SafeStockSum=" + SafeStockSum + ","); strSql.Append("CalculateMethod='" + CalculateMethod + "',"); strSql.Append("Place='" + Place + "',"); strSql.Append("IsEnable=" + IsEnable + ","); strSql.Append("Remark='" + Remark + "',"); strSql.Append("Price=" + Price + ","); strSql.Append("PicID='" + PicID + "',"); strSql.Append("ClientID='" + ClientID + "',"); strSql.Append("SupplierGuid='" + SupplierGuid + "'"); strSql.Append(" where MaterialGuID='" + MaterialGuID + "' "); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.Execute(strSql.ToString());//执行Sql语句无返回值 pComm.Close(); return(true); } catch (System.Exception e) { pComm.Close(); throw e; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add() { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [Employee]("); strSql.Append("EmpGuid,EmpID,EmpName,Sex,Telephone,Address,CardID,Dept"); strSql.Append(")"); strSql.Append(" values ("); strSql.Append("'" + EmpGuid + "',"); strSql.Append("'" + EmpID + "',"); strSql.Append("'" + EmpName + "',"); strSql.Append("'" + Sex + "',"); strSql.Append("'" + Telephone + "',"); strSql.Append("'" + Address + "',"); strSql.Append("'" + CardID + "',"); strSql.Append("'" + Dept + "'"); strSql.Append(")"); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.Execute(strSql.ToString());//执行Sql语句无返回值 pComm.Close(); return(true); } catch (System.Exception e) { pComm.Close(); throw e; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update() { StringBuilder strSql = new StringBuilder(); strSql.Append("update Employee set "); strSql.Append("EmpID='" + EmpID + "',"); strSql.Append("EmpName='" + EmpName + "',"); strSql.Append("Sex='" + Sex + "',"); strSql.Append("Telephone='" + Telephone + "',"); strSql.Append("Address='" + Address + "',"); strSql.Append("CardID='" + CardID + "',"); strSql.Append("Dept='" + Dept + "'"); strSql.Append(" where EmpGuid='" + EmpGuid + "' "); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.Execute(strSql.ToString());//执行Sql语句无返回值 pComm.Close(); return(true); } catch (System.Exception e) { pComm.Close(); throw e; } }
/// <summary> /// 更新审核状态度 /// </summary> /// <returns></returns> public void ChcekCheckBill(string CheckBillGuid, int pass) { CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql); try { string ps_Sql = ""; //删除主表 if (pass == 1) { //通过 ps_Sql = "update CheckBill set CheckPerson='" + SysParams.UserName + "',CheckDate='" + DateTime.Now.ToString() + "' where CheckBillGuid='" + CheckBillGuid + "'"; } else { //不通过 ps_Sql = "update CheckBill set CheckPerson='',CheckDate=null where CheckBillGuid='" + CheckBillGuid + "'"; } pObj_Comm.Execute(ps_Sql); pObj_Comm.Close(); } catch (Exception e) { pObj_Comm.Close(); throw e; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update() { StringBuilder strSql = new StringBuilder(); strSql.Append("update Client set "); strSql.Append("Name='" + Name + "',"); strSql.Append("SimpName='" + SimpName + "',"); strSql.Append("LinkMan='" + LinkMan + "',"); strSql.Append("Telephone='" + Telephone + "',"); strSql.Append("Fax='" + Fax + "',"); strSql.Append("Address='" + Address + "',"); strSql.Append("Zip='" + Zip + "',"); strSql.Append("Remark='" + Remark + "',"); strSql.Append("SellType='" + SellType + "',"); strSql.Append("ProductName='" + ProductName + "',"); strSql.Append("IsEnable=" + IsEnable.ToString() + ""); strSql.Append(" where Guid='" + Guid + "' "); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.Execute(strSql.ToString());//执行Sql语句无返回值 pComm.Close(); return(true); } catch (System.Exception e) { pComm.Close(); throw e; } }
/// <summary> /// 更新审核状态度-二级审核 /// </summary> /// <returns></returns> public void CheckBill2(string RejectOrderGuid, int pass) { CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql); try { string ps_Sql = ""; //删除主表 if (pass == 1) { //通过 ps_Sql = "update RejectOrder set CheckGuid2='" + SysParams.UserID + "',CheckDate2='" + DateTime.Now.ToString() + "' where RejectOrderGuid='" + RejectOrderGuid + "'"; } else { //不通过 ps_Sql = "update RejectOrder set CheckGuid2='',CheckDate2=null where RejectOrderGuid='" + RejectOrderGuid + "'"; } pObj_Comm.Execute(ps_Sql); pObj_Comm.Close(); } catch (Exception e) { pObj_Comm.Close(); throw e; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add() { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [Client]("); strSql.Append("Guid,Name,SimpName,LinkMan,Telephone,Fax,Address,Zip,Remark,ProductName,SellType,IsEnable"); strSql.Append(")"); strSql.Append(" values ("); strSql.Append("'" + Guid + "',"); strSql.Append("'" + Name + "',"); strSql.Append("'" + SimpName + "',"); strSql.Append("'" + LinkMan + "',"); strSql.Append("'" + Telephone + "',"); strSql.Append("'" + Fax + "',"); strSql.Append("'" + Address + "',"); strSql.Append("'" + Zip + "',"); strSql.Append("'" + Remark + "',"); strSql.Append("'" + ProductName + "',"); strSql.Append("'" + SellType + "',"); strSql.Append("" + IsEnable.ToString() + ""); strSql.Append(")"); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.Execute(strSql.ToString());//执行Sql语句无返回值 pComm.Close(); return(true); } catch (System.Exception e) { pComm.Close(); throw e; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update() { StringBuilder strSql = new StringBuilder(); strSql.Append("update Material set "); strSql.Append("UpperLimit=" + UpperLimit + ","); strSql.Append("LowerLimit=" + LowerLimit + ","); strSql.Append("IConsultPrice=" + IConsultPrice + ","); strSql.Append("EConsultPrice=" + EConsultPrice + ","); strSql.Append("CalculateMethod='" + CalculateMethod + "',"); strSql.Append("Remark='" + Remark + "',"); strSql.Append("MaterialId='" + MaterialId + "',"); strSql.Append("MaterialName='" + MaterialName + "',"); strSql.Append("ClassId='" + ClassId + "',"); strSql.Append("Spec='" + Spec + "',"); strSql.Append("Unit='" + Unit + "',"); strSql.Append("BarNo='" + BarNo + "',"); strSql.Append("Place='" + Place + "',"); strSql.Append("Encapsulation='" + Encapsulation + "'"); strSql.Append(" where MaterialGuid='" + MaterialGuid + "' "); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.Execute(strSql.ToString());//执行Sql语句无返回值 pComm.Close(); return(true); } catch (System.Exception e) { pComm.Close(); throw e; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add() { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [Dept]("); strSql.Append("DeptGuid,DeptName,DeptPerson,Telephone,Fax,Address"); strSql.Append(")"); strSql.Append(" values ("); strSql.Append("'" + DeptGuid + "',"); strSql.Append("'" + DeptName + "',"); strSql.Append("'" + DeptPerson + "',"); strSql.Append("'" + Telephone + "',"); strSql.Append("'" + Fax + "',"); strSql.Append("'" + Address + "'"); strSql.Append(")"); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.Execute(strSql.ToString());//执行Sql语句无返回值 pComm.Close(); return(true); } catch (System.Exception e) { pComm.Close(); throw e; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update() { StringBuilder strSql = new StringBuilder(); strSql.Append("update Dept set "); strSql.Append("DeptName='" + DeptName + "',"); strSql.Append("DeptPerson='" + DeptPerson + "',"); strSql.Append("Telephone='" + Telephone + "',"); strSql.Append("Fax='" + Fax + "',"); strSql.Append("Address='" + Address + "'"); strSql.Append(" where DeptGuid='" + DeptGuid + "' "); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.Execute(strSql.ToString());//执行Sql语句无返回值 pComm.Close(); return(true); } catch (System.Exception e) { pComm.Close(); throw e; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add() { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into LOGINUSER("); strSql.Append("USERID,USERNAME,EMAIL,PASSWORD,IsEnable"); strSql.Append(")"); strSql.Append(" values ("); strSql.Append("'" + USERID + "',"); strSql.Append("'" + USERNAME + "',"); strSql.Append("'" + EMAIL + "',"); strSql.Append("'" + PASSWORD + "',"); strSql.Append("" + IsEnable.ToString() + ""); strSql.Append(")"); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.Execute(strSql.ToString());//执行Sql语句无返回值 pComm.Close(); return(true); } catch (System.Exception e) { pComm.Close(); throw e; } }
///<summary> /// 保存数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void SaveMaterialBom(MaterialBom materialbom, List <MaterialBomDetail> materialbomdetail) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //删除集合中的bom子件数据 string strDeleteSql = ""; strDeleteSql = "Delete from MaterialBomDetail where MaterialFatherGuid='" + materialbom.MaterialGuid + "'"; pComm.Execute(strDeleteSql); //删除集合中的bom母件数据 strDeleteSql = ""; strDeleteSql = "Delete from MaterialBom where MaterialGuid='" + materialbom.MaterialGuid + "' "; pComm.Execute(strDeleteSql); //插入母件数据 string strInsertSql = ""; strInsertSql = GetAddSQL(materialbom); pComm.Execute(strInsertSql); //插入子件数据 strInsertSql = ""; for (int i = 0; i < materialbomdetail.Count; i++) { strInsertSql = GetAddDetailSQL(materialbomdetail[i]); pComm.Execute(strInsertSql); } pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
///<summary> /// 保存数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void SaveCheckBill(CheckBill CheckBill, List <CheckBillDetail> CheckBillDetail) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //保存单据主表数据 //先删除主表数据 string strDeleteSql = "Delete from CheckBill where CheckBillGuid='" + CheckBill.CheckBillGuid + "'"; pComm.Execute(strDeleteSql); //插入主表数据 string strInsertSql = GetAddCheckBillSQL(CheckBill); pComm.Execute(strInsertSql); //删除明细表 strDeleteSql = "Delete from CheckBillDetail where CheckBillGuid='" + CheckBill.CheckBillGuid + "'"; pComm.Execute(strDeleteSql); //插入明细表数据 for (int i = 0; i < CheckBillDetail.Count; i++) { strInsertSql = GetAddCheckBillDetailSQL(CheckBillDetail[i]); pComm.Execute(strInsertSql); } pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
///<summary> /// 保存数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void SaveBill(FileInStorage FileInStorage, List <FileInStorageDetail> FileInStorageDetail) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //保存单据主表数据 //先删除主表数据 string strDeleteSql = "Delete from FileInStorage where FileInStorageGuid='" + FileInStorage.FileInStorageGuID + "'"; pComm.Execute(strDeleteSql); //插入主表数据 string strInsertSql = GetAddBillSQL(FileInStorage); pComm.Execute(strInsertSql); //删除明细表 strDeleteSql = "Delete from FileInStorageDetail where FileInStorageGuid='" + FileInStorage.FileInStorageGuID + "'"; pComm.Execute(strDeleteSql); //插入明细表数据 for (int i = 0; i < FileInStorageDetail.Count; i++) { strInsertSql = GetAddBillDetailSQL(FileInStorageDetail[i]); pComm.Execute(strInsertSql); } pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
///<summary> /// 保存数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void SaveBill(RejectOrder RejectOrder, List <RejectOrderDetail> RejectOrderDetail) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //保存单据主表数据 //先删除主表数据 string strDeleteSql = "Delete from RejectOrder where RejectOrderGuid='" + RejectOrder.RejectOrderGuid + "'"; pComm.Execute(strDeleteSql); //插入主表数据 string strInsertSql = GetAddBillSQL(RejectOrder); pComm.Execute(strInsertSql); //删除明细表 strDeleteSql = "Delete from RejectOrderDetail where RejectOrderGuid='" + RejectOrder.RejectOrderGuid + "'"; pComm.Execute(strDeleteSql); //插入明细表数据 for (int i = 0; i < RejectOrderDetail.Count; i++) { strInsertSql = GetAddBillDetailSQL(RejectOrderDetail[i]); pComm.Execute(strInsertSql); } pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
///<summary> /// 保存数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void SaveBill(InitialGoods InitialGoods, List <InitialGoodsDetail> InitialGoodsDetail) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //保存单据主表数据 //先删除主表数据 string strDeleteSql = "Delete from InitialGoods where InitialGoodsGuid='" + InitialGoods.InitialGoodsGuid + "'"; pComm.Execute(strDeleteSql); //插入主表数据 string strInsertSql = GetAddBillSQL(InitialGoods); pComm.Execute(strInsertSql); //删除明细表 strDeleteSql = "Delete from InitialGoodsDetail where InitialGoodsGuid='" + InitialGoods.InitialGoodsGuid + "'"; pComm.Execute(strDeleteSql); //插入明细表数据 for (int i = 0; i < InitialGoodsDetail.Count; i++) { strInsertSql = GetAddBillDetailSQL(InitialGoodsDetail[i]); pComm.Execute(strInsertSql); } pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }
///<summary> /// 保存数据 /// </summary> /// <param name="pObj">信息集实体类</param> /// <returns>返回保存成功(true)或失败(false)</returns> public void SaveChangeBill(ChangeBill ChangeBill, List <ChangeBillDataAttachment> ChangeBillDataAttachment) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { pComm.BeginTrans(); //保存单据主表数据 //先删除主表数据 string strDeleteSql = "Delete from ChangeBill where ChangeBillGuID='" + ChangeBill.ChangeBillGuID + "'"; pComm.Execute(strDeleteSql); //插入主表数据 string strInsertSql = GetAddSQL(ChangeBill); pComm.Execute(strInsertSql); //删除明细表 strDeleteSql = "Delete from ChangeBillDataAttachment where ChangeBillGuID='" + ChangeBill.ChangeBillGuID + "'"; pComm.Execute(strDeleteSql); //插入明细表数据 for (int i = 0; i < ChangeBillDataAttachment.Count; i++) { AddChangeBillDataAttachment(ChangeBillDataAttachment[i], pComm); } pComm.CommitTrans(); } catch (Exception e) { pComm.RollbackTrans(); pComm.Close(); throw e; } }