public void ConstructVO(DataRow p_dtrSource, ref clsLisVendorVO p_objVendor) { p_objVendor.m_intSeq = p_dtrSource["VENDOR_SEQ_INT"] == System.DBNull.Value ? 0 : int.Parse(p_dtrSource["VENDOR_SEQ_INT"].ToString().Trim()); p_objVendor.m_strVendor = p_dtrSource["VENDOR_VCHR"].ToString().Trim(); p_objVendor.m_strId = p_dtrSource["VENDOR_ID_VCHR"].ToString().Trim(); p_objVendor.m_strPycode = p_dtrSource["PYCODE_VCHR"].ToString().Trim(); p_objVendor.m_strWbcode = p_dtrSource["WBCODE_VCHR"].ToString().Trim(); }
public long m_lngUpdate(clsLisVendorVO p_objRecord) { long lngRes = 0; try { lngRes = m_objSvc.m_lngUpdate(m_objPrincipal, p_objRecord); } catch { lngRes = 0; } return(lngRes); }
public long m_lngFind(int p_intID, out clsLisVendorVO p_objRecord) { long lngRes = 0; p_objRecord = null; try { lngRes = m_objSvc.m_lngFind(m_objPrincipal, p_intID, out p_objRecord); } catch { lngRes = 0; } return(lngRes); }
private void m_lsvVendor_Click(object sender, EventArgs e) { if (this.m_lsvVendor.FocusedItem == null) { return; } //变更状态标志 this.m_blnNewVendor = false; clsLisVendorVO objVendor = (clsLisVendorVO)this.m_lsvVendor.FocusedItem.Tag; this.m_txtVDName.Text = objVendor.m_strVendor; this.m_txtVendorCode.Text = objVendor.m_strId; this.m_txtVDPYCode.Text = objVendor.m_strPycode; this.m_txtVDWBCode.Text = objVendor.m_strWbcode; }
public long m_lngInsert(clsLisVendorVO p_objRecord) { int intID = -1; long lngRes = 0; try { lngRes = m_objSvc.m_lngInsert(m_objPrincipal, p_objRecord, out intID); } catch { lngRes = 0; } if (lngRes > 0) { p_objRecord.m_intSeq = intID; } return(lngRes); }
private void m_mthLoadData() { //加入空项 clsLisVendorVO obj = new clsLisVendorVO(); obj.m_strVendor = string.Empty; obj.m_intSeq = DBAssist.NullInt; this.Items.Add(obj); //加载数据 clsLisVendorVO[] objVendorArr = null; long lngRes = clsTmdVendorSmp.s_object.m_lngFind(out objVendorArr); if (lngRes > 0 && objVendorArr != null) { this.Items.AddRange(objVendorArr); } }
private void m_mthLoadVendor() { Cursor.Current = Cursors.WaitCursor; //加载数据 clsLisVendorVO[] objVendorArr = null; clsTmdVendorSmp.s_object.m_lngFind(out objVendorArr); if (objVendorArr == null) { objVendorArr = new clsLisVendorVO[0]; } m_lsvVendor.Tag = objVendorArr; //填充列表 m_mthShowVendorList(objVendorArr); Cursor.Current = Cursors.Default; }
private void m_cmdVDDelete_Click(object sender, EventArgs e) { if (this.m_lsvVendor.FocusedItem == null) { return; } Cursor.Current = Cursors.WaitCursor; this.m_cmdVDDelete.Enabled = false; clsLisVendorVO objVendor = (clsLisVendorVO)this.m_lsvVendor.FocusedItem.Tag; clsLisVendorVO objCopy = new clsLisVendorVO(); objVendor.m_mthCopyTo(objCopy); long lngRes = clsTmdCheckMethodSmp.s_object.m_lngDelete(objCopy.m_intSeq); if (lngRes > 0) {//成功 int intIdx = this.m_lsvVendor.FocusedItem.Index; this.m_lsvVendor.FocusedItem.Remove(); //设置新的具有焦点的 ListView 项 if (intIdx < this.m_lsvVendor.Items.Count) { this.m_lsvVendor.Items[intIdx].Selected = true; this.m_lsvVendor.Items[intIdx].Focused = true; this.m_lsvVendor_Click(null, null); } else if (intIdx - 1 >= 0) { this.m_lsvVendor.Items[intIdx - 1].Selected = true; this.m_lsvVendor.Items[intIdx - 1].Focused = true; this.m_lsvVendor_Click(null, null); } } else {//失败 clsCommonDialog.m_mthShowDBError(); } this.m_cmdVDDelete.Enabled = true; Cursor.Current = Cursors.Default; }
public long m_lngUpdate(System.Security.Principal.IPrincipal p_objPrincipal, clsLisVendorVO p_objVendor) { long lngRes = 0; clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.LIS.clsTmdVendorSvc", "m_lngUpdate"); if (lngRes <= 0) { return(-1); } com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); string strSQL = @"UPDATE T_BSE_LIS_VENDOR SET VENDOR_VCHR=?, VENDOR_ID_VCHR=?, PYCODE_VCHR=?, WBCODE_VCHR=? WHERE VENDOR_SEQ_INT=? " ; try { System.Data.IDataParameter[] objODPArr = clsPublicSvc.m_objConstructIDataParameterArr( p_objVendor.m_strVendor, p_objVendor.m_strId, p_objVendor.m_strPycode, p_objVendor.m_strWbcode, p_objVendor.m_intSeq ); long lngRecEff = -1; //往表增加记录 lngRes = 0; lngRes = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngRecEff, objODPArr); objHRPSvc.Dispose(); } catch (Exception objEx) { new clsLogText().LogError(objEx); } return(lngRes); }
public long m_lngFind(System.Security.Principal.IPrincipal p_objPrincipal, out clsLisVendorVO[] p_objResultArr) { long lngRes = 0; p_objResultArr = null; clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.LIS.clsTmdVendorSvc", "m_lngFind"); if (lngRes <= 0) { return(-1); } string strSQL = @"SELECT * FROM T_BSE_LIS_VENDOR "; com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); try { DataTable dtbResult = null; lngRes = 0; lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref dtbResult); objHRPSvc.Dispose(); if (lngRes == 1 && dtbResult != null && dtbResult.Rows.Count > 0) { p_objResultArr = new clsLisVendorVO[dtbResult.Rows.Count]; for (int i = 0; i < p_objResultArr.Length; i++) { p_objResultArr[i] = new clsLisVendorVO(); this.ConstructVO(dtbResult.Rows[i], ref p_objResultArr[i]); } } } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngFind(System.Security.Principal.IPrincipal p_objPrincipal, int p_intSeq, out clsLisVendorVO p_objVendor) { long lngRes = 0; p_objVendor = null; clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.LIS.clsTmdVendorSvc", "m_lngFind"); if (lngRes <= 0) { return(-1); } com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); string strSQL = @"SELECT * FROM T_BSE_LIS_VENDOR WHERE VENDOR_SEQ_INT = ?"; try { System.Data.IDataParameter[] objODPArr = clsPublicSvc.m_objConstructIDataParameterArr( p_intSeq); DataTable dtbResult = null; lngRes = 0; lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult, objODPArr); objHRPSvc.Dispose(); if (lngRes == 1 && dtbResult != null && dtbResult.Rows.Count > 0) { p_objVendor = new clsLisVendorVO(); this.ConstructVO(dtbResult.Rows[0], ref p_objVendor); } } catch (Exception objEx) { new clsLogText().LogError(objEx); } return(lngRes); }
private void m_cmdVDSave_Click(object sender, EventArgs e) { if (this.m_lsvVendor.FocusedItem == null && !this.m_blnNewVendor) { return; } Cursor.Current = Cursors.WaitCursor; this.m_cmdVDSave.Enabled = false; if (this.m_blnNewVendor) {//新增的保存 clsLisVendorVO objVendor = new clsLisVendorVO(); objVendor.m_strVendor = this.m_txtVDName.Text.Trim(); objVendor.m_strId = this.m_txtVendorCode.Text.Trim(); objVendor.m_strPycode = this.m_txtVDPYCode.Text.Trim(); objVendor.m_strWbcode = this.m_txtVDWBCode.Text.Trim(); long lngRes = clsTmdVendorSmp.s_object.m_lngInsert(objVendor); if (lngRes > 0) {//成功 //更新状态标志 this.m_blnNewVendor = false; //加入到集合 clsLisVendorVO[] objVendorArr = (clsLisVendorVO[])this.m_lsvVendor.Tag; clsLisVendorVO[] objVendorNewArr = new clsLisVendorVO[objVendorArr.Length + 1]; objVendorArr.CopyTo(objVendorNewArr, 0); objVendorNewArr[objVendorNewArr.Length - 1] = objVendor; this.m_lsvVendor.Tag = objVendorNewArr; //添加新项 ListViewItem item = new ListViewItem(objVendor.m_strVendor); item.SubItems.Add(objVendor.m_strId); item.SubItems.Add(objVendor.m_strPycode); item.SubItems.Add(objVendor.m_strWbcode); item.Tag = objVendor; this.m_lsvVendor.Items.Add(item); item.Selected = true; item.Focused = true; this.m_lsvVendor_Click(null, null); } else {//失败 clsCommonDialog.m_mthShowDBError(); } } else {//修改的保存 clsLisVendorVO objVendor = (clsLisVendorVO)this.m_lsvVendor.FocusedItem.Tag; clsLisVendorVO objNewVendor = new clsLisVendorVO(); objVendor.m_mthCopyTo(objNewVendor); objNewVendor.m_strVendor = this.m_txtVDName.Text.Trim(); objNewVendor.m_strId = this.m_txtVendorCode.Text.Trim(); objNewVendor.m_strPycode = this.m_txtVDPYCode.Text.Trim(); objNewVendor.m_strWbcode = this.m_txtVDWBCode.Text.Trim(); long lngRes = clsTmdVendorSmp.s_object.m_lngUpdate(objNewVendor); if (lngRes > 0) {//成功 objNewVendor.m_mthCopyTo(objVendor); this.m_lsvVendor.FocusedItem.Text = objVendor.m_strVendor; this.m_lsvVendor.FocusedItem.SubItems[1].Text = objVendor.m_strId; this.m_lsvVendor.FocusedItem.SubItems[2].Text = objVendor.m_strPycode; this.m_lsvVendor.FocusedItem.SubItems[3].Text = objVendor.m_strWbcode; } else {//失败 clsCommonDialog.m_mthShowDBError(); } } this.m_cmdVDSave.Enabled = true; Cursor.Current = Cursors.Default; }
public long m_lngInsert(System.Security.Principal.IPrincipal p_objPrincipal, clsLisVendorVO p_objVendor, out int p_intSeq) { long lngRes = 0; p_intSeq = -1; clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.LIS.clsTmdVendorSvc", "m_lngInsert"); if (lngRes <= 0) { return(-1); } com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); string strSQL = @" INSERT INTO T_BSE_LIS_VENDOR ( VENDOR_SEQ_INT, VENDOR_VCHR, VENDOR_ID_VCHR, PYCODE_VCHR, WBCODE_VCHR ) VALUES ( ?, ? ,? , ?, ?)"; try { lngRes = 0; lngRes = objHRPSvc.m_lngGenerateNewID("T_BSE_LIS_VENDOR", "VENDOR_SEQ_INT", out p_intSeq); if (lngRes <= 0) { return(-1); } lngRes = 0; System.Data.IDataParameter[] objODPArr = clsPublicSvc.m_objConstructIDataParameterArr( p_intSeq, p_objVendor.m_strVendor, p_objVendor.m_strId, p_objVendor.m_strPycode, p_objVendor.m_strWbcode ); long lngRecEff = -1; //往表增加记录 lngRes = 0; lngRes = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngRecEff, objODPArr); objHRPSvc.Dispose(); if (lngRes > 0) { p_objVendor.m_intSeq = p_intSeq;//给VO赋值ID } else { p_intSeq = -1; } } catch (Exception objEx) { new clsLogText().LogError(objEx); } return(lngRes); }