/// <summary> /// Method for updating a person in the database. /// </summary> /// <param name="person">Takes a Person (relative) object as argument.</param> /// <returns>Returns number of rows affected in the database.</returns> public int EditPerson(Relative person) { /******************************************************************* * EDITPERSON() - PUBLIC *******************************************************************/ var sql = $"UPDATE Persons " + $"SET firstName = @fname," + $"lastName = @lName," + $"birthDate = @birthDate," + $"deathDate = @deathDate," + $"motherId = @motherId," + $"fatherId = @fatherId," + $"birthPlace = @birthPlace, " + $"deathPlace = @deathPlace " + $"WHERE id = @id"; return(ExecuteSQL(sql, ("@fName", $"{person.FirstName}"), ("@lName", $"{person.LastName}"), ("@birthDate", $"{person.BirthDate}"), ("@deathDate", $"{person.DeathDate}"), ("@motherId", $"{person.MotherId}"), ("@fatherId", $"{person.FatherId}"), ("@birthPlace", $"{person.BirthPlace}"), ("@deathPlace", $"{person.DeathPlace}"), ("@id", $"{person.Id}"))); }
private void LoadDataSource() { string strFilter = this.ctlSearcher1.GetFilter(); DataTable dtUser = ExecuteSQL.CallView(112, "", strFilter, ""); this.grdMain.DataSource = dtUser.DefaultView; }
private void btnDeletePermission_Click(object sender, EventArgs e) { try { if (this.mtnSelectedNode != null && this.mtnSelectedNode != mtnTop) { DataRow dr = this.mtnSelectedNode.Tag as DataRow; long lPermissionID = dr["PermissionID"] == DBNull.Value ? 0 : Convert.ToInt64(dr["PermissionID"]); if (LB.WinFunction.LBCommonHelper.ConfirmMessage("确认删除?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { LBDbParameterCollection parmCollection = new LBDbParameterCollection(); parmCollection.Add(new LBParameter("PermissionID", enLBDbType.Int64, lPermissionID)); DataSet dsReturn; Dictionary <string, object> dictOut; ExecuteSQL.CallSP(11003, parmCollection, out dsReturn, out dictOut); BuildPermissionTree(); } } } catch (Exception ex) { LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex); } }
private void btnAdd_Click(object sender, EventArgs e) { try { int iSPType = 14800; if (mlCustomerTypeID > 0) { iSPType = 14801; } this.VerifyTextBoxIsEmpty(); LBDbParameterCollection parmCol = new LBDbParameterCollection(); parmCol.Add(new LBParameter("CustomerTypeID", enLBDbType.Int64, mlCustomerTypeID)); parmCol.Add(new LBParameter("CustomerTypeCode", enLBDbType.String, this.txtCustomerTypeCode.Text)); parmCol.Add(new LBParameter("CustomerTypeName", enLBDbType.String, this.txtCustomerTypeName.Text)); DataSet dsReturn; Dictionary <string, object> dictValue; ExecuteSQL.CallSP(iSPType, parmCol, out dsReturn, out dictValue); if (dictValue.ContainsKey("CustomerTypeID")) { long.TryParse(dictValue["CustomerTypeID"].ToString(), out mlCustomerTypeID); } LB.WinFunction.LBCommonHelper.ShowCommonMessage("保存成功!"); } catch (Exception ex) { LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex); } }
private void btnDeleteItemType_Click(object sender, EventArgs e) { try { if (this.tvReportType.SelectedNode == null || this.tvReportType.SelectedNode.Tag == null) { return; } DataRow dr = this.tvReportType.SelectedNode.Tag as DataRow; long lItemTypeID = LBConverter.ToInt64(dr["ReportViewID"]); if (LB.WinFunction.LBCommonHelper.ConfirmMessage("是否确认删除改决策分析报表?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (lItemTypeID > 0) { LBDbParameterCollection parmCol = new LBDbParameterCollection(); parmCol.Add(new LBParameter("ReportViewID", enLBDbType.Int64, lItemTypeID)); DataSet dsReturn; Dictionary <string, object> dictValue; ExecuteSQL.CallSP(14402, parmCol, out dsReturn, out dictValue); } BuildTree(); } } catch (Exception ex) { LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex); } }
private void btnPrintOutBill_Click(object sender, EventArgs e) { try { //允许补打磅单次数 int iAllowPrintOutReportCount; SysConfigValue.GetSysConfig("AllowPrintOutReportCount", out iAllowPrintOutReportCount); if (iAllowPrintOutReportCount == 0) { throw new Exception("系统设置不允许补打磅单!"); } if (mlSaleCarOutBillID == 0) { throw new Exception("请选择需要补打的数据行!"); } DataTable dtOut = ExecuteSQL.CallView(124, "OutPrintCount", "SaleCarOutBillID=" + this.mlSaleCarOutBillID, ""); if (dtOut.Rows.Count > 0) { int iOutPrintCount = LBConverter.ToInt32(dtOut.Rows[0]["OutPrintCount"]); if (iOutPrintCount >= iAllowPrintOutReportCount + 1) { throw new Exception("补打次数已超出系统设置的次数!"); } } LBPreviceReport.PreviceReport(mlSaleCarOutBillID, enWeightType.WeightOut, enRequestReportActionType.DirectPrint); } catch (Exception ex) { LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex); } }
private void SaveOutSalesPicture(object objSaleCarReturnBillID) { long lSaleCarReturnBillID = LBConverter.ToInt64(objSaleCarReturnBillID); try { CameraInfo cameraInfo = new CameraInfo(); if (GetCameraEvent != null) { GetCameraEvent(this, cameraInfo); } byte[] bImg1 = cameraInfo.Image1; byte[] bImg2 = cameraInfo.Image2; byte[] bImg3 = cameraInfo.Image3; byte[] bImg4 = cameraInfo.Image4; LBDbParameterCollection parmCol = new LBDbParameterCollection(); parmCol.Add(new LBParameter("SaleCarReturnBillID", enLBDbType.Int64, lSaleCarReturnBillID)); parmCol.Add(new LBParameter("MonitoreImg1", enLBDbType.Bytes, bImg1)); parmCol.Add(new LBParameter("MonitoreImg2", enLBDbType.Bytes, bImg2)); parmCol.Add(new LBParameter("MonitoreImg3", enLBDbType.Bytes, bImg3)); parmCol.Add(new LBParameter("MonitoreImg4", enLBDbType.Bytes, bImg4)); DataSet dsReturn; Dictionary <string, object> dictValue; ExecuteSQL.CallSP(30004, parmCol, out dsReturn, out dictValue); } catch (Exception ex) { LBErrorLog.InsertErrorLog("保存出场图片时报错,退货单号:" + lSaleCarReturnBillID.ToString() + "\n错误信息:" + ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { try { this.VerifyTextBoxIsEmpty();//校验控件值是否为空 int iSPType = mlItemTypeID > 0 ? 20501 : 20500; LBDbParameterCollection parmCol = new LBDbParameterCollection(); parmCol.Add(new LBParameter("ItemTypeID", enLBDbType.Int64, mlItemTypeID)); parmCol.Add(new LBParameter("ItemTypeName", enLBDbType.String, this.txtItemTypeName.Text)); DataSet dsReturn; Dictionary <string, object> dictValue; ExecuteSQL.CallSP(iSPType, parmCol, out dsReturn, out dictValue); if (dictValue.ContainsKey("ItemTypeID")) { long.TryParse(dictValue["ItemTypeID"].ToString(), out mlItemTypeID); } LB.WinFunction.LBCommonHelper.ShowCommonMessage("保存成功!"); btnDelete.Visible = mlItemTypeID > 0; } catch (Exception ex) { LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex); } }
bool GetCardRefCarInfo(long lCardID, out string strBindCarNum) { bool bolExists = false; strBindCarNum = ""; string strFilter = ""; if (mlCarID > 0) { strFilter = "CardID = " + lCardID.ToString() + " and CarID<>" + mlCarID.ToString(); } else { strFilter = "CardID = " + lCardID.ToString(); } DataTable dtCar = ExecuteSQL.CallView(113, "", strFilter, ""); if (dtCar.Rows.Count > 0) { bolExists = true; strBindCarNum = dtCar.Rows[0]["CarNum"].ToString().TrimEnd(); } return(bolExists); }
private long SaveInBill() { long lCarID = LBConverter.ToInt64(this.txtCarID.TextBox.SelectedItemID); long lItemID = LBConverter.ToInt64(this.txtItemID.TextBox.SelectedItemID); long lCustomerID = LBConverter.ToInt64(this.txtCustomerID.TextBox.SelectedItemID); int iReceiveType = 1; using (DataTable dtCustomer = ExecuteSQL.CallView(112, "CustomerID,ReceiveType,TotalReceivedAmount,SalesReceivedAmount", "CustomerID=" + lCustomerID.ToString(), "")) { if (dtCustomer.Rows.Count > 0) { lCustomerID = LBConverter.ToInt64(dtCustomer.Rows[0]["CustomerID"]); //客户收款方式 iReceiveType = LBConverter.ToInt32(dtCustomer.Rows[0]["ReceiveType"]); } } Dictionary <string, double> dictTest = new Dictionary <string, double>(); DateTime dt1 = DateTime.Now; DateTime dt2 = DateTime.Now; long lSaleCarInBillID = 0; int iCalculateType = LBConverter.ToInt32(this.txtCalculateType.SelectedValue); decimal decCarTare = LBConverter.ToDecimal(this.txtCarTare.Text); string strBillDateIn = Convert.ToDateTime(this.txtBillDateIn.Text).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(this.txtBillTimeIn.Text).ToString("HH:mm:ss"); if (decCarTare == 0) { throw new Exception("当前【皮重】值为0,无法保存!"); } LBDbParameterCollection parmCol = new LBDbParameterCollection(); parmCol.Add(new LBParameter("SaleCarInBillID", enLBDbType.Int64, 0)); parmCol.Add(new LBParameter("SaleCarInBillCode", enLBDbType.String, "")); parmCol.Add(new LBParameter("BillDate", enLBDbType.DateTime, Convert.ToDateTime(strBillDateIn))); parmCol.Add(new LBParameter("CarID", enLBDbType.Int64, lCarID)); parmCol.Add(new LBParameter("ItemID", enLBDbType.Int64, lItemID)); parmCol.Add(new LBParameter("CustomerID", enLBDbType.Int64, lCustomerID)); parmCol.Add(new LBParameter("Description", enLBDbType.String, this.txtAddReason.Text)); parmCol.Add(new LBParameter("ReceiveType", enLBDbType.Int32, iReceiveType)); parmCol.Add(new LBParameter("CalculateType", enLBDbType.Int32, iCalculateType)); parmCol.Add(new LBParameter("CarTare", enLBDbType.Decimal, decCarTare)); DataSet dsReturn; Dictionary <string, object> dictValue; ExecuteSQL.CallSP(14100, parmCol, out dsReturn, out dictValue); if (dictValue.ContainsKey("SaleCarInBillID")) { lSaleCarInBillID = LBConverter.ToInt64(dictValue["SaleCarInBillID"]); } if (dictValue.ContainsKey("SaleCarInBillCode")) { this.txtSaleCarInBillCode.Text = dictValue["SaleCarInBillCode"].ToString(); } return(lSaleCarInBillID); }
private void ReadFieldValue() { if (mlReceiveBillHeaderID > 0) { DataTable dtHeader = ExecuteSQL.CallView(111, "", "ReceiveBillHeaderID=" + mlReceiveBillHeaderID, ""); if (dtHeader.Rows.Count > 0) { DataRow drHeader = dtHeader.Rows[0]; bool bolIsApprove = LBConverter.ToBoolean(drHeader["IsApprove"]); bool bolIsCancel = LBConverter.ToBoolean(drHeader["IsCancel"]); decimal decReceiveAmount = LBConverter.ToDecimal(drHeader["ReceiveAmount"]); decimal decSalesReceiveAmountAdd = LBConverter.ToDecimal(drHeader["SalesReceiveAmountAdd"]); decimal decSalesReceiveAmountReduce = LBConverter.ToDecimal(drHeader["SalesReceiveAmountReduce"]); decimal decOriginalAmount = LBConverter.ToDecimal(drHeader["OriginalAmount"]); this.txtBillDate.Text = LBConverter.ToString(drHeader["BillDate"]); this.txtBillStatus.Text = bolIsApprove?"已审核": (bolIsCancel?"已作废":("未审核")); this.txtCustomerID.TextBox.SelectedItemID = drHeader["CustomerID"].ToString(); this.txtDescription.Text = drHeader["Description"].ToString(); this.txtReceiveAmount.Text = decReceiveAmount.ToString("N0"); this.txtReceiveBillCode.Text = drHeader["ReceiveBillCode"].ToString(); this.txtChangedBy.Text = drHeader["ChangedBy"].ToString(); this.txtChangeTime.Text = drHeader["ChangeTime"].ToString(); this.txtApproveBy.Text = drHeader["ApproveBy"].ToString(); this.txtApproveTime.Text = drHeader["ApproveTime"].ToString(); this.txtCancelBy.Text = drHeader["CancelBy"].ToString(); this.txtCancelTime.Text = drHeader["CancelTime"].ToString(); this.txtRPReceiveType.TextBox.SelectedItemID = drHeader["ChargeTypeID"]; this.txtReceiveBankID.TextBox.SelectedItemID = drHeader["ReceiveBankID"]; } } }
public List <string> getFieldsList(string tableName) { string sqlQuery = "select c.name from sysobjects o,syscolumns c where o.id =c.id and o.name=?"; List <string> lsFields = ExecuteSQL.ExecuteQuery(sqlQuery, tableName, "name"); return(lsFields); }
//保存授权信息 private void btnSave_Click(object sender, EventArgs e) { try { if (this.mdtUserPermission != null && this.mdtUserPermissionData != null) { this.grdMain.CurrentCell = null; this.grdMain.EndEdit(); this.mdtUserPermission.TableName = "UserPermission"; this.mdtUserPermissionData.TableName = "UserPermissionData"; DataTable dtSPIN = new DataTable(); dtSPIN.Columns.Add("UserID", typeof(long)); dtSPIN.Columns.Add("DTUserPermission", typeof(DataTable)); dtSPIN.Columns.Add("DTUserPermissionData", typeof(DataTable)); DataRow drNew = dtSPIN.NewRow(); drNew["UserID"] = mlUserID; drNew["DTUserPermission"] = this.mdtUserPermission.Copy(); drNew["DTUserPermissionData"] = this.mdtUserPermissionData.Copy(); dtSPIN.Rows.Add(drNew); dtSPIN.AcceptChanges(); DataTable dtReturn; DataSet dsReturn; ExecuteSQL.CallSP(13102, dtSPIN, out dsReturn, out dtReturn); LB.WinFunction.LBCommonHelper.ShowCommonMessage("保存成功!"); } } catch (Exception ex) { LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex); } }
private void btnSave_Click(object sender, EventArgs e) { try { int WeightType = LBConverter.ToInt32(this.txtWeightType.SelectedValue);; LBDbParameterCollection parmCol = new LBDbParameterCollection(); parmCol.Add(new LBParameter("WeightType", enLBDbType.Int32, WeightType)); parmCol.Add(new LBParameter("MachineName", enLBDbType.String, LoginInfo.MachineName)); DataSet dsReturn; Dictionary <string, object> dictValue; ExecuteSQL.CallSP(14200, parmCol, out dsReturn, out dictValue); if (_OrgWeightType != WeightType) { IsChangeWeightType = true; LB.WinFunction.LBCommonHelper.ShowCommonMessage("保存成功!修改后需要注销并重新登录系统!"); this.Close(); } else { LB.WinFunction.LBCommonHelper.ShowCommonMessage("保存成功!"); } } catch (Exception ex) { LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex); } }
private void btnSave_Click(object sender, EventArgs e) { try { int iReadSerialBaud = LBConverter.ToInt32(this.txtReadSerialBaud.Text); string strReadSerialName = this.txtReadSerialName.SelectedValue == null?"": this.txtReadSerialName.SelectedValue.ToString(); string strWriteSerialName = this.txtWriteSerialName.SelectedValue == null ? "" : this.txtWriteSerialName.SelectedValue.ToString(); LBDbParameterCollection parmCol = new LBDbParameterCollection(); parmCol.Add(new LBParameter("ReadCardSerialCOM", enLBDbType.String, strReadSerialName)); parmCol.Add(new LBParameter("WriteCardSerialCOM", enLBDbType.String, strWriteSerialName)); parmCol.Add(new LBParameter("ReadCardBaud", enLBDbType.Int32, iReadSerialBaud)); parmCol.Add(new LBParameter("MachineName", enLBDbType.String, LoginInfo.MachineName)); parmCol.Add(new LBParameter("UseReadCard", enLBDbType.Int32, (this.cbUseReadCard.Checked?1:0))); parmCol.Add(new LBParameter("UseWriteCard", enLBDbType.Int32, (this.cbUseWriteCard.Checked ? 1 : 0))); parmCol.Add(new LBParameter("ConnectType", enLBDbType.Int32, (this.rbNet.Checked ? 1 : 0))); parmCol.Add(new LBParameter("IPAddress", enLBDbType.String, this.txtIPAddress.Text)); parmCol.Add(new LBParameter("IPPort", enLBDbType.Int32, LBConverter.ToInt32(this.txtPort.Text))); DataSet dsReturn; Dictionary <string, object> dictValue; ExecuteSQL.CallSP(20503, parmCol, out dsReturn, out dictValue); LBCardHelper.StartSerial(enCardType.ReadCard); LB.WinFunction.LBCommonHelper.ShowCommonMessage("保存成功!"); } catch (Exception ex) { LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex); } }
private void LoadCarDataSource(long lCarID) { string strFilter = "CarID=" + lCarID; if (this.txtBillDateFrom.Text.TrimEnd() != "") { if (strFilter != "") { strFilter += " and "; } strFilter += "CreateTime >= '" + this.txtBillDateFrom.Text.TrimEnd() + "'"; } if (this.txtBillDateTo.Text.TrimEnd() != "") { if (strFilter != "") { strFilter += " and "; } strFilter += "CreateTime < '" + Convert.ToDateTime(this.txtBillDateTo.Text.TrimEnd()).AddDays(1) + "'"; } DataTable dtDetail = ExecuteSQL.CallView(131, "", strFilter, "CreateTime desc"); this.grdCarWeight.DataSource = dtDetail.DefaultView; }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); DataTable dtSupplier = ExecuteSQL.CallView(139);//读取供应商信息 DataRow drNew = dtSupplier.NewRow(); drNew["SupplierName"] = ""; dtSupplier.Rows.InsertAt(drNew, 0); DataTable dtCard = ExecuteSQL.CallView(138);//读取卡片信息 drNew = dtCard.NewRow(); drNew["CardName"] = ""; dtCard.Rows.InsertAt(drNew, 0); this.txtSupplierID.DataSource = dtSupplier.DefaultView;//读取客户信息 this.txtSupplierID.DisplayMember = "SupplierName"; this.txtSupplierID.ValueMember = "SupplierID"; this.txtCardID.DataSource = dtCard.DefaultView;//读取客户信息 this.txtCardID.DisplayMember = "CardCode"; this.txtCardID.ValueMember = "CardID"; //if(mlCustomerID>0) // this.txtSupplierID.SelectedValue = mlCustomerID; ReadFieldValue(); SetButtonStatus(); mTimerFrare = new System.Windows.Forms.Timer(); mTimerFrare.Interval = 100; mTimerFrare.Enabled = true; mTimerFrare.Tick += mTimerFrare_Tick; }
/// <summary> /// 读取未同步且已完成的入场单 /// </summary> /// <returns></returns> public static DataTable ReadUnSynchronousBill() { string strFilter = "isnull(IsSynchronousToServer,0) = 0 and (IsCancel =1 or SaleCarOutBillID is not null)"; DataTable dtBill = ExecuteSQL.CallView(125, "", strFilter, "SaleCarOutBillID desc,SaleCarInBillID desc"); return(dtBill); }
protected void btnSaveEdit_Click(object sender, EventArgs e) { try { StringDictionary sd = new StringDictionary(); sd.Add("@cmd", "6"); sd.Add("@TagEPCID", txtEditEpcid.Text.Trim()); sd.Add("@userID", userid); sd.Add("@Tag_Id", ViewState["RowId"].ToString()); DataSet ds = ExecuteSQL.ExecuteDataSet("PROC_ASSET_TAG_MASTER", sd); if (IsEmpty(ds)) { lblMessages.Text = "Record Updated Successfully"; } else { lblMessages.Text = "Record Already Exists"; } ResetEditControl(); bindDataGrid(); mpeEdit.Hide(); } catch (Exception ex) { lblMessages.Text = ex.Message; mpeEdit.Hide(); } }
private void btnCancel_Click(object sender, EventArgs e) { try { frmSaleCarInOutCancel frmCancel = new frmSaleCarInOutCancel(txtCarID.TextBox.Text); LBShowForm.ShowDialog(frmCancel); if (frmCancel.IsAllowCancel) { LBDbParameterCollection parmCol = new LBDbParameterCollection(); parmCol.Add(new LBParameter("SaleCarInBillID", enLBDbType.Int64, mlSaleCarInBillID)); DataSet dsReturn; Dictionary <string, object> dictValue; ExecuteSQL.CallSP(14106, parmCol, out dsReturn, out dictValue); LB.WinFunction.LBCommonHelper.ShowCommonMessage("作废成功!"); ReadFeildValue(); } } catch (Exception ex) { LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex); } }
private void btnRefCar_Click(object sender, EventArgs e) { try { frmCarRefCustomerQuery frmCarQuery = new frmCarRefCustomerQuery(mlCustomerID); LBShowForm.ShowDialog(frmCarQuery); if (frmCarQuery.LstReturn.Count > 0) { //将车辆关联当前客户 DataTable dtSPIN = new DataTable(); dtSPIN.Columns.Add("CarID", typeof(long)); dtSPIN.Columns.Add("CustomerID", typeof(long)); foreach (DataRow dr in frmCarQuery.LstReturn) { DataRow drNew = dtSPIN.NewRow(); drNew["CarID"] = dr["CarID"]; drNew["CustomerID"] = mlCustomerID; dtSPIN.Rows.Add(drNew); } dtSPIN.AcceptChanges(); DataSet dsReturn; DataTable dtReturn; Dictionary <string, object> dictValue; ExecuteSQL.CallSP(13503, dtSPIN, out dsReturn, out dtReturn); LoadCarDataSource(); } } catch (Exception ex) { LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex); } }
private void InitData() { DataTable dtCustom = ExecuteSQL.CallView(139, "", "", "SupplierName asc"); this.txtSupplierID.TextBox.LBViewType = 139; //this.txtCustomerID.TextBox.LBSort = "SortLevel desc,CustomerName asc"; this.txtSupplierID.TextBox.IDColumnName = "SupplierID"; this.txtSupplierID.TextBox.TextColumnName = "SupplierName"; this.txtSupplierID.TextBox.PopDataSource = dtCustom.DefaultView; DataTable dtCar = ExecuteSQL.CallView(113, "", "", "SortLevel desc,CarNum asc"); this.txtCarID.TextBox.LBViewType = 113; this.txtCarID.TextBox.LBSort = "SortLevel desc,CarNum asc"; this.txtCarID.TextBox.IDColumnName = "CarID"; this.txtCarID.TextBox.TextColumnName = "CarNum"; this.txtCarID.TextBox.PopDataSource = dtCar.DefaultView; this.txtSupplierID.TextBox.IsAllowNotExists = true; this.txtCarID.TextBox.IsAllowNotExists = true; this.txtCarID.TextBox.TextChanged += CarTextBox_TextChanged; //this.txtCarTare.TextChanged += TxtCarTare_TextChanged; //this.txtTotalWeight.TextChanged += TxtCarTare_TextChanged; }
public static DataTable GetReportTemplateRowByType(long lReportTypeID) { DataTable dtTemplate = null; LBDbParameterCollection parmCol = new LBDbParameterCollection(); parmCol.Add(new LBParameter("ReportTypeID", enLBDbType.Int64, lReportTypeID)); parmCol.Add(new LBParameter("MachineName", enLBDbType.String, LoginInfo.MachineName)); DataSet dsReturn; Dictionary <string, object> dictValue; ExecuteSQL.CallSP(12004, parmCol, out dsReturn, out dictValue); if (dsReturn != null && dsReturn.Tables.Count > 0) { dtTemplate = dsReturn.Tables[0]; } //DataTable dtReportTemplate = ExecuteSQL.CallView(105, "", "ReportTypeID=" + lReportTypeID, ""); //dtReportTemplate.DefaultView.RowFilter = "MachineName='" + LoginInfo.MachineName + "'"; //if (dtReportTemplate.DefaultView.Count > 0) //{ // return dtReportTemplate.DefaultView[0].Row; //} //else if (dtReportTemplate.Rows.Count > 0) //{ // return dtReportTemplate.Rows[0]; //} return(dtTemplate); }
/// <summary> /// 读取控件参数值 /// </summary> private void ReadFieldValue() { if (mlBackUpConfigID > 0) { DataTable dtBackUp = ExecuteSQL.CallView(108, "", "BackUpConfigID=" + mlBackUpConfigID, ""); if (dtBackUp.Rows.Count > 0) { DataRow drBackUp = dtBackUp.Rows[0]; int iBackUpType = LBConverter.ToInt32(drBackUp["BackUpType"]); int iBackUpWeek = LBConverter.ToInt32(drBackUp["BackUpWeek"]); int iBackUpHour = LBConverter.ToInt32(drBackUp["BackUpHour"]); int iBackUpMinu = LBConverter.ToInt32(drBackUp["BackUpMinu"]); bool bolIsEffect = LBConverter.ToBoolean(drBackUp["IsEffect"]); int iBackUpFileMaxNum = LBConverter.ToInt32(drBackUp["BackUpFileMaxNum"]); string strBackUpPath = LBConverter.ToString(drBackUp["BackUpPath"]); string strBackUpName = LBConverter.ToString(drBackUp["BackUpName"]); this.txtBackUpFileMaxNum.Text = iBackUpFileMaxNum.ToString(); this.txtBackUpHour.Text = iBackUpHour.ToString(); this.txtBackUpMinu.Text = iBackUpMinu.ToString(); this.txtBackUpWeek.SelectedValue = iBackUpWeek; this.txtBackUpType.SelectedValue = iBackUpType; this.txtBackUpName.Text = strBackUpName; this.chkIsEffect.Checked = bolIsEffect; } } }
private static void GetSerialInfo( out string strSerialName, out bool IsHeaderEffect, out bool IsTailEffect, out int HeaderXType, out int TailXType, out int HeaderYType, out int TailYType) { strSerialName = ""; IsHeaderEffect = false; IsTailEffect = false; HeaderXType = 0; TailXType = 0; HeaderYType = 0; TailYType = 0; string strMathineName = LoginInfo.MachineName; DataTable dtSerial = ExecuteSQL.CallView(134, "", "MachineName='" + strMathineName + "'", ""); if (dtSerial.Rows.Count > 0) { DataRow dr = dtSerial.Rows[0]; //long lWeightDeviceUserTypeID = LBConverter.ToInt64(dr["WeightDeviceUserTypeID"]); strSerialName = dr["SerialName"].ToString(); IsHeaderEffect = LBConverter.ToBoolean(dr["IsHeaderEffect"]); IsTailEffect = LBConverter.ToBoolean(dr["IsTailEffect"]); HeaderXType = LBConverter.ToInt32(dr["HeaderXType"]); TailXType = LBConverter.ToInt32(dr["TailXType"]); HeaderYType = LBConverter.ToInt32(dr["HeaderYType"]); TailYType = LBConverter.ToInt32(dr["TailYType"]); } }
private void ReSearchData() { string strFilter = ""; string strSQL = "select * from dbo.Db_v_ItemBase"; if (tvItemType.SelectedNode != null && tvItemType.SelectedNode.Parent != null) { DataRow dr = tvItemType.SelectedNode.Tag as DataRow; strFilter = "ItemTypeID = " + dr["ItemTypeID"].ToString(); } if (this.txtFilter.Text.TrimEnd() != "") { strFilter += string.Format(@"ItemTypeName like '%{0}%' or ItemCode like '%{0}%' or ItemName like '%{0}%' or ItemMode like '%{0}%' or UOMName like '%{0}%' or Description like '%{0}%'", this.txtFilter.Text.TrimEnd()); } if (strFilter != "") { strSQL += " where " + strFilter; } DataTable dtView = ExecuteSQL.CallDirectSQL(strSQL); this.grdMain.DataSource = dtView.DefaultView; }
private void ReadFieldValue() { DataTable dtCamera = ExecuteSQL.CallView(122, "", "MachineName='" + LoginInfo.MachineName + "'", ""); if (dtCamera.Rows.Count > 0) { DataRow dr = dtCamera.Rows[0]; this.txtIP1.Text = dr["IPAddress1"].ToString().TrimEnd(); this.txtPort1.Text = LBConverter.ToInt32(dr["Port1"]).ToString(); this.txtAccount1.Text = dr["Account1"].ToString().TrimEnd(); this.txtPassword1.Text = dr["Password1"].ToString().TrimEnd(); this.txtIP2.Text = dr["IPAddress2"].ToString().TrimEnd(); this.txtPort2.Text = LBConverter.ToInt32(dr["Port2"]).ToString(); this.txtAccount2.Text = dr["Account2"].ToString().TrimEnd(); this.txtPassword2.Text = dr["Password2"].ToString().TrimEnd(); this.txtIP3.Text = dr["IPAddress3"].ToString().TrimEnd(); this.txtPort3.Text = LBConverter.ToInt32(dr["Port3"]).ToString(); this.txtAccount3.Text = dr["Account3"].ToString().TrimEnd(); this.txtPassword3.Text = dr["Password3"].ToString().TrimEnd(); this.txtIP4.Text = dr["IPAddress4"].ToString().TrimEnd(); this.txtPort4.Text = LBConverter.ToInt32(dr["Port4"]).ToString(); this.txtAccount4.Text = dr["Account4"].ToString().TrimEnd(); this.txtPassword4.Text = dr["Password4"].ToString().TrimEnd(); this.cbUserCamera1.Checked = LBConverter.ToBoolean(dr["UseCamera1"]); this.cbUserCamera2.Checked = LBConverter.ToBoolean(dr["UseCamera2"]); this.cbUserCamera3.Checked = LBConverter.ToBoolean(dr["UseCamera3"]); this.cbUserCamera4.Checked = LBConverter.ToBoolean(dr["UseCamera4"]); } }
protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); if (LB.WinFunction.LBCommonHelper.ConfirmMessage("是否确认退出系统?", "提示", MessageBoxButtons.YesNo) != DialogResult.Yes) { e.Cancel = true; return; } if (this.mThreadStatus.ThreadState != ThreadState.Stopped || this.mThreadStatus.ThreadState != ThreadState.StopRequested) { bolIsClosing = true; this.mThreadStatus.Abort(); } try { SessionHelper.EndTakeSession(); ExecuteSQL.LogOutSession();//删除Session } catch (Exception ex) { } }
public static void GetAlert(ref AlertData alert, string comID, string deviceID, string recDateTime) { string strSQL = "SELECT unitID FROM tblUnits WHERE deviceID = " + deviceID + " and comID = " + comID; ProcessAlerts processAlerts = new ProcessAlerts(); ExecuteSQL exec = new ExecuteSQL(); DataSet ds; int unitID; try { ds = exec.getDataSet(strSQL); unitID = int.Parse(ds.Tables[0].Rows[0]["unitID"].ToString()); processAlerts.UnitID = unitID; processAlerts.ComID = int.Parse(comID); processAlerts.AlertTime = recDateTime; processAlerts.GetAlert(); alert = processAlerts.Alert; } catch (Exception ex) { Console.WriteLine("GetAlert(): " + ex.Message); } finally { processAlerts = null; exec = null; } }
/// <summary> /// 读取控件参数值 /// </summary> private void ReadFieldValue() { if (mlItemID > 0) { DataTable dtBackUp = ExecuteSQL.CallView(203, "", "ItemID=" + mlItemID, ""); if (dtBackUp.Rows.Count > 0) { DataRow dr = dtBackUp.Rows[0]; string strItemCode = LBConverter.ToString(dr["ItemCode"]); string strK3ItemCode = LBConverter.ToString(dr["K3ItemCode"]); string strItemName = LBConverter.ToString(dr["ItemName"]); string strItemMode = LBConverter.ToString(dr["ItemMode"]); decimal dItemRate = LBConverter.ToDecimal(dr["ItemRate"]); long lUOMID = LBConverter.ToInt32(dr["UOMID"]); long lItemTypeID = LBConverter.ToInt32(dr["ItemTypeID"]); string strDescription = LBConverter.ToString(dr["Description"]); bool bIsForbid = LBConverter.ToBoolean(dr["IsForbid"]); decimal decprice = LBConverter.ToDecimal(dr["ItemPrice"]); this.txtK3ItemCode.Text = strK3ItemCode; this.txtItemCode.Text = strItemCode; this.txtItemName.Text = strItemName; this.txtItemMode.Text = strItemMode; this.txtItemRate.Text = dItemRate.ToString(); this.txtUOMID.SelectedValue = lUOMID; this.txtItemTypeID.SelectedValue = lItemTypeID; this.txtDescription.Text = strDescription; this.chkIsForbid.Checked = bIsForbid; this.txtPrice.Text = decprice.ToString("0.000"); } } }
protected override void OnTextChanged(EventArgs e) { base.OnTextChanged(e); if (this.TriggersEnabled) { switch (this.Triggers.OnTextChanged(this.Text)) { case TriggerState.Show: { if (LBViewType > 0) { PopDataSource = ExecuteSQL.CallView(LBViewType, "", "", LBSort).DefaultView; } this.ShowList(true); } break; case TriggerState.Hide: { this.HideList(); } break; default: { this.UpdateList(true); } break; } } }