public static void Main() { // Read the 'StockQuote.wsdl' file as input. ServiceDescription myServiceDescription = ServiceDescription.Read("StockQuote.wsdl"); // Get the operation fault collection and remove the operation fault with the name 'ErrorString'. PortTypeCollection myPortTypeCollection = myServiceDescription.PortTypes; PortType myPortType = myPortTypeCollection[0]; OperationCollection myOperationCollection = myPortType.Operations; Operation myOperation = myOperationCollection[0]; OperationFaultCollection myOperationFaultCollection = myOperation.Faults; if (myOperationFaultCollection.Contains(myOperationFaultCollection["ErrorString"])) { myOperationFaultCollection.Remove(myOperationFaultCollection["ErrorString"]); } // Get the fault binding collection and remove the fault binding with the name 'ErrorString'. // <Snippet1> BindingCollection myBindingCollection = myServiceDescription.Bindings; Binding myBinding = myBindingCollection[0]; OperationBindingCollection myOperationBindingCollection = myBinding.Operations; OperationBinding myOperationBinding = myOperationBindingCollection[0]; FaultBindingCollection myFaultBindingCollection = myOperationBinding.Faults; if (myFaultBindingCollection.Contains(myFaultBindingCollection["ErrorString"])) { myFaultBindingCollection.Remove(myFaultBindingCollection["ErrorString"]); } // </Snippet1> myServiceDescription.Write(Console.Out); }
/// <summary> /// get all productionformmaterial /// <summary> /// <param name=formid>formid</param> /// <param name=out emsg>return error message</param> ///<returns>details of all productionformmaterial</returns> public BindingCollection <modProductionFormMaterial> GetProductionFormMaterial(string formid, out string emsg) { try { BindingCollection <modProductionFormMaterial> modellist = new BindingCollection <modProductionFormMaterial>(); //Execute a query to read the categories string sql = string.Format("select form_id,seq,product_id,product_name,specify,size,qty,cost_price,warehouse_id,remark from production_form_material where form_id='{0}' order by form_id,seq", formid); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modProductionFormMaterial model = new modProductionFormMaterial(); model.FormId = dalUtility.ConvertToString(rdr["form_id"]); model.Seq = dalUtility.ConvertToInt(rdr["seq"]); model.ProductId = dalUtility.ConvertToString(rdr["product_id"]); model.ProductName = dalUtility.ConvertToString(rdr["product_name"]); model.Specify = dalUtility.ConvertToString(rdr["specify"]); model.Size = dalUtility.ConvertToDecimal(rdr["size"]); model.Qty = dalUtility.ConvertToDecimal(rdr["qty"]); model.CostPrice = dalUtility.ConvertToDecimal(rdr["cost_price"]); model.WarehouseId = dalUtility.ConvertToString(rdr["warehouse_id"]); model.Remark = dalUtility.ConvertToString(rdr["remark"]); modellist.Add(model); } } emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
private Dictionary <string, BindingCollection> MergeBindings(IEnumerable <DefaultBinding> bindingSets) { var final = new Dictionary <string, BindingCollection>(); foreach (var bindingSet in bindingSets) { foreach (KeyValuePair <string, BindingCollection> kvp in bindingSet.bindings) { string actionSetName = kvp.Key; BindingCollection bindings = kvp.Value; if (!final.ContainsKey(actionSetName)) { final.Add(actionSetName, new BindingCollection()); } final[actionSetName].chords.AddRange(bindings.chords); final[actionSetName].haptics.AddRange(bindings.haptics); final[actionSetName].poses.AddRange(bindings.poses); final[actionSetName].skeleton.AddRange(bindings.skeleton); final[actionSetName].sources.AddRange(bindings.sources); } } return(final); }
public void Test_Create_Collection_With_Null_Array() { IBindingCollection collection = new BindingCollection(null); Assert.Equal(0, collection.TypeCount); Assert.Equal(0, collection.BindingCount); }
public static void SetFormStatus(Form frm) { dalTaskGrant bll = new dalTaskGrant(); BindingCollection <modTaskGrant> grantlist = bll.GetUserGrantData(true, false, Util.UserId, string.Empty, string.Empty, out Util.emsg); foreach (Control ctl in frm.Controls) { if (ctl.GetType().ToString() == "LXMS.ButtonEx" || ctl.GetType().ToString() == "System.Windows.Forms.LinkLabel") { ctl.Enabled = false; foreach (modTaskGrant mod in grantlist) { if (mod.Url.CompareTo(ctl.Name) == 0) { ctl.Enabled = true; break; } } } else { SetSubControlStatus(ctl, grantlist); } } }
public void LoadData() { try { this.Cursor = Cursors.WaitCursor; DBGrid.Rows.Clear(); BindingCollection <modAccProfitReport> list = _dal.GetAccProfitReport(cboAccName.ComboBox.SelectedValue.ToString(), Util.IsTrialBalance, out Util.emsg); DBGrid.DataSource = list; if (list != null && list.Count > 0) { DBGrid.AlternatingRowsDefaultCellStyle.BackColor = Color.Empty; DBGrid.Rows[DBGrid.RowCount - 1].DefaultCellStyle.BackColor = frmOptions.ALTERNATING_BACKCOLOR; DBGrid.Rows[DBGrid.RowCount - 1].DefaultCellStyle.ForeColor = Color.Red; DBGrid.Columns["ThisMonth"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.Columns["ThisYear"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.Columns["AdFlag"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
/// <summary> /// get all sysparameters /// <summary> /// <param name=paraid>paraid</param> /// <param name=out emsg>return error message</param> ///<returns>details of all sysparameters</returns> public BindingCollection <modSysParameters> GetIList(string paraid, out string emsg) { try { BindingCollection <modSysParameters> modellist = new BindingCollection <modSysParameters>(); //Execute a query to read the categories string sql = string.Format("select para_id,para_name,para_value,remark,update_user,update_time from sys_parameters where para_id='{0}' order by para_id", paraid); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modSysParameters model = new modSysParameters(); model.ParaId = dalUtility.ConvertToString(rdr["para_id"]); model.ParaName = dalUtility.ConvertToString(rdr["para_name"]); model.ParaValue = dalUtility.ConvertToString(rdr["para_value"]); model.Remark = dalUtility.ConvertToString(rdr["remark"]); model.UpdateUser = dalUtility.ConvertToString(rdr["update_user"]); model.UpdateTime = dalUtility.ConvertToString(rdr["update_time"]); modellist.Add(model); } } emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
/// <summary> /// audit production form /// <summary> /// <param name=formid>formid</param> /// <param name=updateuser>updateuser</param> /// <param name=out emsg>return error message</param> /// <returns>true/false</returns> public bool Audit(string formid, string updateuser, out string emsg) { string sql = string.Empty; SqlConnection conn = SqlHelper.getConn(); conn.Open(); SqlTransaction trans = conn.BeginTransaction(); SqlCommand cmd = new SqlCommand(); try { modProductionForm mod = GetItem(formid, out emsg); if (mod.Status == 1) { emsg = "这张单据已经审核,您无须再审"; return(false); } BindingCollection <modProductionFormWare> listware = GetProductionFormWare(formid, out emsg); if (listware != null && listware.Count > 0) { foreach (modProductionFormWare modware in listware) { sql = string.Format("insert into warehouse_product_inout(warehouse_id,product_id,size,form_id,form_type,inv_no,inout_date,start_qty,input_qty,output_qty,remark,update_user,update_time)values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}',getdate())", modware.WarehouseId, modware.ProductId, modware.Size, formid, mod.FormType, mod.No, mod.FormDate, 0, modware.Qty, 0, modware.Remark, updateuser); SqlHelper.PrepareCommand(cmd, conn, trans, CommandType.Text, sql, null); cmd.ExecuteNonQuery(); } } BindingCollection <modProductionFormMaterial> listmaterial = GetProductionFormMaterial(formid, out emsg); if (listmaterial != null && listmaterial.Count > 0) { foreach (modProductionFormMaterial modmaterial in listmaterial) { sql = string.Format("insert into warehouse_product_inout(warehouse_id,product_id,size,form_id,form_type,inv_no,inout_date,start_qty,input_qty,output_qty,remark,update_user,update_time)values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}',getdate())", modmaterial.WarehouseId, modmaterial.ProductId, modmaterial.Size, formid, mod.FormType, mod.No, mod.FormDate, 0, 0, modmaterial.Qty, modmaterial.Remark, updateuser); SqlHelper.PrepareCommand(cmd, conn, trans, CommandType.Text, sql, null); cmd.ExecuteNonQuery(); } } sql = string.Format("update production_form set status={0},audit_man='{1}',audit_time=getdate() where form_id='{2}'", 1, updateuser, formid); SqlHelper.PrepareCommand(cmd, conn, trans, CommandType.Text, sql, null); cmd.ExecuteNonQuery(); trans.Commit(); emsg = string.Empty; return(true); } catch (Exception ex) { trans.Rollback(); emsg = dalUtility.ErrorMessage(ex.Message); return(false); } finally { trans.Dispose(); cmd.Dispose(); if (conn.State != ConnectionState.Closed) { conn.Dispose(); } } }
private void LoadTree() { try { this.Cursor = Cursors.WaitCursor; tvLeft.AllowDrop = true; tvLeft.Nodes.Clear(); tvLeft.ImageList = Util.GetImageList(); dalProductTypeList dal = new dalProductTypeList(); BindingCollection <modProductTypeList> list = dal.GetIList(true, out Util.emsg); if (list != null) { foreach (modProductTypeList mod in list) { tvLeft.Nodes.Add(mod.ProductType, mod.ProductType, 0, 1); } if (tvLeft.Nodes.Count > 0) { tvLeft.SelectedNode = tvLeft.Nodes[0]; } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void LoadData() { try { this.Cursor = Cursors.WaitCursor; BindingCollection <modAccCredenceSummary> list = _dal.GetCredenceSummary(cboAccName.ComboBox.SelectedValue.ToString(), Util.IsTrialBalance, out Util.emsg); DBGrid.DataSource = list; if (list == null && !string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } else { DBGrid.Columns["BorrowMoney"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.Columns["LendMoney"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.Columns["BorrowMoney"].Width = 140; DBGrid.Columns["LendMoney"].Width = 140; DBGrid.AlternatingRowsDefaultCellStyle.BackColor = Color.Empty; DBGrid.Rows[DBGrid.RowCount - 1].DefaultCellStyle.BackColor = frmOptions.ALTERNATING_BACKCOLOR; modAccCredenceSummary mod = (modAccCredenceSummary)DBGrid.Rows[DBGrid.RowCount - 1].DataBoundItem; Status1.Text = clsTranslate.TranslateString("Borrow Money") + ": " + mod.BorrowMoney; Status2.Text = clsTranslate.TranslateString("Lend Money") + ": " + mod.LendMoney; } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
public void LoadPriceData(string productid) { dalProductSalePrice dal = new dalProductSalePrice(); BindingCollection <modProductSalePrice> list = dal.GetProductSalePrice(productid, out Util.emsg); DBGridPrice.DataSource = list; if (list != null) { DBGridPrice.Columns["ProductId"].Visible = false; DBGridPrice.Columns["UpdateUser"].Visible = false; DBGridPrice.Columns["UpdateTime"].Visible = false; DBGridPrice.ReadOnly = false; DBGridPrice.Columns["CustLevel"].Width = 80; DBGridPrice.Columns["Price"].Width = 100; DBGridPrice.Columns["Price"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGridPrice.Columns["CustLevel"].ReadOnly = true; DBGridPrice.Columns["Price"].ReadOnly = false; DBGridPrice.AlternatingRowsDefaultCellStyle.BackColor = Color.Empty; DBGridPrice.Columns["CustLevel"].DefaultCellStyle.BackColor = frmOptions.ALTERNATING_BACKCOLOR; if (DBGridPrice.RowCount > 0) { DBGridPrice.CurrentCell = DBGridPrice.Rows[0].Cells["Price"]; } } }
private void toolSavePrice_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; DBGridPrice.EndEdit(); dalProductSalePrice dal = new dalProductSalePrice(); BindingCollection <modProductSalePrice> list = (BindingCollection <modProductSalePrice>)DBGridPrice.DataSource; bool ret = dal.Save(list, out Util.emsg); if (ret) { MessageBox.Show("数据保存成功!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
/// <summary> /// get all accreceivablelist /// <summary> /// <param name=accname>accname</param> /// <param name=currency>currency</param> /// <param name=out emsg>return error message</param> ///<returns>details of all accreceivablelist</returns> public BindingCollection <modStartReceivable> GetStartReceivable(string accname, string currency, decimal exchange_rate, out string emsg) { try { BindingCollection <modStartReceivable> modellist = new BindingCollection <modStartReceivable>(); //Execute a query to read the categories string sql = string.Format("select a.cust_id,a.cust_name,isnull(b.start_mny,0) start_mny from customer_list a left join " + "(select cust_id,currency,start_mny,exchange_rate from acc_receivable_list where acc_name='{0}' and seq=0 and currency='{1}') b on a.cust_id=b.cust_id where a.currency='{2}'", accname, currency, currency); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modStartReceivable model = new modStartReceivable(); model.AccName = accname; model.CustId = dalUtility.ConvertToString(rdr["cust_id"]); model.CustName = dalUtility.ConvertToString(rdr["cust_name"]); model.Currency = currency; model.ExchangeRate = exchange_rate; model.StartMny = dalUtility.ConvertToDecimal(rdr["start_mny"]); modellist.Add(model); } } emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
private void LoadData() { try { this.Cursor = Cursors.WaitCursor; BindingCollection <modCustReceivableSummary> list = _dal.GetCustReceivableSummary(cboAccName.ComboBox.SelectedValue.ToString(), out Util.emsg); DBGrid.DataSource = list; if (list == null && !string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } else { DBGrid.Columns[0].Visible = false; DBGrid.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.Columns[6].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.Columns[7].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.Columns[8].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.AlternatingRowsDefaultCellStyle.BackColor = Color.Empty; DBGrid.Rows[DBGrid.RowCount - 1].DefaultCellStyle.BackColor = frmOptions.ALTERNATING_BACKCOLOR; } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void mnuDetail_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (DBGrid.CurrentRow == null) { return; } BindingCollection <modAccReceivableList> list = _dal.GetIList(cboAccName.ComboBox.SelectedValue.ToString(), DBGrid.CurrentRow.Cells["custid"].Value.ToString(), out Util.emsg); if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList(list[0].CustName, list); frm.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
/// <summary> /// get all accperiodlist /// <summary> /// <param name=accyear>accyear</param> /// <param name=out emsg>return error message</param> ///<returns>details of all accperiodlist</returns> public BindingCollection <modAccPeriodList> GetIList(out string emsg) { try { BindingCollection <modAccPeriodList> modellist = new BindingCollection <modAccPeriodList>(); //Execute a query to read the categories string sql = "select acc_name,seq,acc_year,acc_month,start_date,end_date,cost_flag,lock_flag,employee_count,update_user,update_time from acc_period_list order by seq desc"; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modAccPeriodList model = new modAccPeriodList(); model.AccName = dalUtility.ConvertToString(rdr["acc_name"]); model.Seq = dalUtility.ConvertToInt(rdr["seq"]); model.AccYear = dalUtility.ConvertToInt(rdr["acc_year"]); model.AccMonth = dalUtility.ConvertToInt(rdr["acc_month"]); model.StartDate = dalUtility.ConvertToDateTime(rdr["start_date"]); model.EndDate = dalUtility.ConvertToDateTime(rdr["end_date"]); model.CostFlag = dalUtility.ConvertToInt(rdr["cost_flag"]); model.LockFlag = dalUtility.ConvertToInt(rdr["lock_flag"]); model.EmployeeCount = dalUtility.ConvertToInt(rdr["employee_count"]); model.UpdateUser = dalUtility.ConvertToString(rdr["update_user"]); model.UpdateTime = dalUtility.ConvertToDateTime(rdr["update_time"]); modellist.Add(model); } } emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
internal FPageGridColumnsSetting(Control parentControl, DataGridView dgv, Func <string> getColSettingFilePath, Action <string, bool> columnVisibleChangedNotify) : this() { this._parentControl = parentControl; this._dgv = dgv; this._getColSettingFilePath = getColSettingFilePath; this._columnVisibleChangedNotify = columnVisibleChangedNotify; this._columnSettingInfoList = new BindingCollection <ColumnSettingInfo>(this); this._dgv.DataSourceChanged += this.DataSourceChanged; this.TopLevel = false; this.Dock = DockStyle.Fill; this.IsAllowMinimize = false; this.IsUseInOutEffect = false; this._lastParentControlSize = new Size(100, 100); this.dgvColumnSetting.DataSource = this._columnSettingInfoList.DataSource; this.dgvColumnSetting.Columns[this.dgvColumnSetting.Columns.Count - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; this.Visible = true; this.SwitchColumnSettingDockStatus(this._columnSettingDockStatus, PageGridColumnSettingStatus.Dock); dgvColumnSetting.LostFocus += DgvColumnSetting_LostFocus; }
/// <summary> /// get all acccommondigest /// <summary> /// <param name=digesttypelist>digesttypelist</param> /// <param name=out emsg>return error message</param> ///<returns>details of all acccommondigest</returns> public BindingCollection <modAccCommonDigest> GetIList(string digesttypelist, out string emsg) { try { BindingCollection <modAccCommonDigest> modellist = new BindingCollection <modAccCommonDigest>(); //Execute a query to read the categories string digesttypewhere = string.Empty; if (!string.IsNullOrEmpty(digesttypelist) && digesttypelist.CompareTo("ALL") != 0) { digesttypewhere = "and digest_type in ('" + digesttypelist.Replace(",", "','") + "') "; } string sql = "select digest,digest_type,update_user,update_time from acc_common_digest where 1=1 " + digesttypewhere + "order by digest_type, digest"; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modAccCommonDigest model = new modAccCommonDigest(); model.Digest = dalUtility.ConvertToString(rdr["digest"]); model.DigestType = dalUtility.ConvertToString(rdr["digest_type"]); model.UpdateUser = dalUtility.ConvertToString(rdr["update_user"]); model.UpdateTime = dalUtility.ConvertToDateTime(rdr["update_time"]); modellist.Add(model); } } emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
private void LoadData() { try { this.Cursor = Cursors.WaitCursor; if (cboAccName.SelectedIndex == -1) { return; } DBGrid.toolCancelFrozen_Click(null, null); modAccPeriodList modPeriod = (modAccPeriodList)cboAccName.SelectedItem; BindingCollection <modAccCredenceList> list = _dal.GetIList(modPeriod.AccName, string.Empty, Util.IsTrialBalance, out Util.emsg); DBGrid.DataSource = list; if (list == null && !string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { AddComboBoxColumns(); for (int i = 0; i < list.Count; i++) { if (list[i].Status == 1) { DBGrid.Rows[i].DefaultCellStyle.ForeColor = Color.DarkGray; } } if (modPeriod.LockFlag == 1 || Util.IsTrialBalance) { toolNew.Visible = false; toolEdit.Visible = false; toolDel.Visible = false; toolAudit.Visible = false; toolReset.Visible = false; toolTrial.Visible = false; toolBalance.Visible = false; } else { toolNew.Visible = true; toolEdit.Visible = true; toolDel.Visible = true; toolAudit.Visible = true; toolReset.Visible = true; toolTrial.Visible = true; toolBalance.Visible = true; } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void LoadData() { try { this.Cursor = Cursors.WaitCursor; DBGrid.toolCancelFrozen_Click(null, null); BindingCollection <modAccOtherReceivableForm> list = _dal.GetIList(rbStatus0.Checked ? "0" : "1", string.Empty, string.Empty, rbStatus0.Checked ? string.Empty : dtpFrom.Text, rbStatus0.Checked ? string.Empty : dtpTo.Text, out Util.emsg); DBGrid.DataSource = list; if (list == null && !string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { AddComboBoxColumns(); } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
/// <summary> /// get new credence list /// <summary> /// <param name=fromdate>fromdate</param> /// <param name=todate>todate</param> /// <param name=out emsg>return error message</param> ///<returns>details of all salesshipment</returns> public BindingCollection <modAccReceivableForm> GetWaitCredenceList(string fromdate, string todate, out string emsg) { try { BindingCollection <modAccReceivableForm> modellist = new BindingCollection <modAccReceivableForm>(); //Execute a query to read the categories string formdatewhere = string.Empty; if (!string.IsNullOrEmpty(fromdate)) { formdatewhere = "and a.form_date >= '" + Convert.ToDateTime(fromdate) + "' "; } if (!string.IsNullOrEmpty(todate)) { formdatewhere += "and a.form_date <= '" + Convert.ToDateTime(todate) + "' "; } string sql = "select a.id,a.status,a.form_date,a.no,a.cust_id,b.cust_name,a.currency,a.exchange_rate,a.get_mny,a.receivable_mny,a.subject_id,c.subject_name,a.detail_id,a.detail_name,a.check_no,a.check_type,a.bank_name,a.promise_date,a.remark,a.update_user,a.update_time,a.audit_man,a.audit_time,a.acc_name,a.acc_seq " + "from acc_receivable_form a inner join customer_list b on a.cust_id=b.cust_id inner join acc_subject_list c on a.subject_id=c.subject_id where a.status=1 and (a.acc_name is null or a.acc_name='') and a.acc_seq=0 " + formdatewhere + " order by a.id"; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modAccReceivableForm model = new modAccReceivableForm(); model.Id = dalUtility.ConvertToInt(rdr["id"]); model.Status = dalUtility.ConvertToInt(rdr["status"]); model.FormDate = dalUtility.ConvertToDateTime(rdr["form_date"]); model.No = dalUtility.ConvertToString(rdr["no"]); model.CustId = dalUtility.ConvertToString(rdr["cust_id"]); model.CustName = dalUtility.ConvertToString(rdr["cust_name"]); model.Currency = dalUtility.ConvertToString(rdr["currency"]); model.ExchangeRate = dalUtility.ConvertToDecimal(rdr["exchange_rate"]); model.GetMny = dalUtility.ConvertToDecimal(rdr["get_mny"]); model.ReceivableMny = dalUtility.ConvertToDecimal(rdr["receivable_mny"]); model.SubjectId = dalUtility.ConvertToString(rdr["subject_id"]); model.SubjectName = dalUtility.ConvertToString(rdr["subject_name"]); model.DetailId = dalUtility.ConvertToString(rdr["detail_id"]); model.DetailName = dalUtility.ConvertToString(rdr["detail_name"]); model.CheckNo = dalUtility.ConvertToString(rdr["check_no"]); model.CheckType = dalUtility.ConvertToString(rdr["check_type"]); model.BankName = dalUtility.ConvertToString(rdr["bank_name"]); model.PromiseDate = dalUtility.ConvertToDateTime(rdr["promise_date"]); model.Remark = dalUtility.ConvertToString(rdr["remark"]); model.UpdateUser = dalUtility.ConvertToString(rdr["update_user"]); model.UpdateTime = dalUtility.ConvertToDateTime(rdr["update_time"]); model.AuditMan = dalUtility.ConvertToString(rdr["audit_man"]); model.AuditTime = dalUtility.ConvertToDateTime(rdr["audit_time"]); model.AccName = dalUtility.ConvertToString(rdr["acc_name"]); model.AccSeq = dalUtility.ConvertToInt(rdr["acc_seq"]); modellist.Add(model); } } emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
/// <summary> /// update price of production form /// <summary> /// <param name=mod>model object of production form</param> /// <param name=out emsg>return error message</param> /// <returns>true/false</returns> public bool UpdatePrice(BindingCollection <modProductionFormWare> listware, BindingCollection <modProductionFormMaterial> listmaterial, decimal detailsum, decimal processmny, string updateuser, out string emsg) { using (TransactionScope transaction = new TransactionScope())//使用事务 { try { string sql = string.Empty; foreach (modProductionFormWare modware in listware) { sql = string.Format("update production_form_ware set cost_price={0} where form_id='{1}' and seq='{2}'", modware.CostPrice, modware.FormId, modware.Seq); SqlHelper.ExecuteNonQuery(sql); } foreach (modProductionFormMaterial modmaterial in listmaterial) { sql = string.Format("update production_form_material set cost_price={0} where form_id='{1}' and seq='{2}'", modmaterial.CostPrice, modmaterial.FormId, modmaterial.Seq); SqlHelper.ExecuteNonQuery(sql); } sql = string.Format("update production_form set detail_sum={0},process_mny={1},price_status={2},audit_man='{3}',audit_time=getdate() where form_id='{4}'", detailsum, processmny, 1, updateuser, listware[0].FormId); SqlHelper.ExecuteNonQuery(sql); transaction.Complete();//就这句就可以了。 emsg = string.Empty; return(true); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(false); } } }
/// <summary> /// get all accbalancestyle /// <summary> /// <param name=out emsg>return error message</param> ///<returns>details of all accbalancestyle</returns> public BindingCollection <modAccBalanceStyle> GetIList(out string emsg) { try { BindingCollection <modAccBalanceStyle> modellist = new BindingCollection <modAccBalanceStyle>(); //Execute a query to read the categories string sql = "select balance_style,update_user,update_time from acc_balance_style order by balance_style"; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modAccBalanceStyle model = new modAccBalanceStyle(); model.BalanceStyle = dalUtility.ConvertToString(rdr["balance_style"]); model.UpdateUser = dalUtility.ConvertToString(rdr["update_user"]); model.UpdateTime = dalUtility.ConvertToDateTime(rdr["update_time"]); modellist.Add(model); } } emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
/// <summary> /// get all customertype /// <summary> /// <param name=validonly>status is valid</param> /// <param name=out emsg>return error message</param> ///<returns>details of all customertype</returns> public BindingCollection <modCustomerType> GetIList(bool validonly, out string emsg) { try { BindingCollection <modCustomerType> modellist = new BindingCollection <modCustomerType>(); //Execute a query to read the categories string getwhere = validonly == true ? "and status=1" : string.Empty; string sql = "select cust_type,status,update_user,update_time from customer_type where 1=1 " + getwhere + "order by cust_type"; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modCustomerType model = new modCustomerType(dalUtility.ConvertToString(rdr["cust_type"]), dalUtility.ConvertToInt(rdr["status"]), dalUtility.ConvertToString(rdr["update_user"]), dalUtility.ConvertToDateTime(rdr["update_time"])); modellist.Add(model); } } emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
/// <summary> /// get all acccurrencylist /// <summary> /// <param name=out emsg>return error message</param> ///<returns>details of all acccurrencylist</returns> public BindingCollection <modAccCurrencyList> GetIList(out string emsg) { try { BindingCollection <modAccCurrencyList> modellist = new BindingCollection <modAccCurrencyList>(); //Execute a query to read the categories string sql = "select currency,exchange_rate,owner_flag,update_user,update_time from acc_currency_list order by owner_flag desc,currency"; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modAccCurrencyList model = new modAccCurrencyList(); model.Currency = dalUtility.ConvertToString(rdr["currency"]); model.ExchangeRate = dalUtility.ConvertToDecimal(rdr["exchange_rate"]); model.OwnerFlag = dalUtility.ConvertToInt(rdr["owner_flag"]); model.UpdateUser = dalUtility.ConvertToString(rdr["update_user"]); model.UpdateTime = dalUtility.ConvertToDateTime(rdr["update_time"]); modellist.Add(model); } } emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
public static void SetSubControlStatus(Control ctl, BindingCollection <modTaskGrant> grantlist) { if (ctl.Controls.Count > 0) { foreach (Control ch in ctl.Controls) { if (ch.GetType().ToString() == "LXMS.ButtonEx" || ch.GetType().ToString() == "System.Windows.Forms.LinkLabel") { ch.Enabled = false; foreach (modTaskGrant mod in grantlist) { if (mod.Url.CompareTo(ch.Name) == 0) { ch.Enabled = true; break; } } } else { SetSubControlStatus(ch, grantlist); } } } }
/// <summary> /// get web grant form name list /// <summary> /// <param name=userid>userid</param> /// <param name=groupidlist>groupidlist</param> ///<returns>get granted data by userid</returns> public string GetWebGrantForm(string userid, out string emsg) { try { System.Text.StringBuilder sb = new System.Text.StringBuilder(); BindingCollection <modTaskGrant> modellist = new BindingCollection <modTaskGrant>(); string sql = string.Format("select a.form_name from sys_task_list a,sys_task_grant b where a.task_code=b.task_code and b.role_id='{0}' " + "union select a.form_name from sys_task_list a,sys_task_grant b,sys_user_list c where a.task_code=b.task_code and b.role_id=c.role_id " + "and a.status=1 and c.user_id='{1}' ", userid, userid); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { sb.Append(rdr[0].ToString()); sb.Append(";"); } emsg = string.Empty; return(sb.ToString()); } } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
/// <summary> /// get all customerscorerule /// <summary> /// <param name=out emsg>return error message</param> ///<returns>details of all customerscorerule</returns> public BindingCollection <modCustomerScoreRule> GetIList(string traceflaglist, out string emsg) { try { BindingCollection <modCustomerScoreRule> modellist = new BindingCollection <modCustomerScoreRule>(); //Execute a query to read the categories string traceflagwhere = string.Empty; if (!string.IsNullOrEmpty(traceflaglist) && traceflaglist.CompareTo("ALL") != 0) { traceflagwhere = "and trace_flag in ('" + traceflaglist.Replace(",", "','") + "') "; } string sql = "select action_code,action_type,scores,trace_flag,update_user,update_time from customer_score_rule where 1=1 " + traceflagwhere + " order by seq"; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modCustomerScoreRule model = new modCustomerScoreRule(); model.ActionCode = dalUtility.ConvertToString(rdr["action_code"]); model.ActionType = dalUtility.ConvertToString(rdr["action_type"]); model.Scores = dalUtility.ConvertToDecimal(rdr["scores"]); model.TraceFlag = dalUtility.ConvertToInt(rdr["trace_flag"]); model.UpdateUser = dalUtility.ConvertToString(rdr["update_user"]); model.UpdateTime = dalUtility.ConvertToDateTime(rdr["update_time"]); modellist.Add(model); } } emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
/// <summary> /// get all assetworkqty /// <summary> /// <param name=accname>accname</param> /// <param name=out emsg>return error message</param> ///<returns>details of all assetworkqty</returns> public BindingCollection <modAssetWorkQty> GetIList(string accname, out string emsg) { try { BindingCollection <modAssetWorkQty> modellist = new BindingCollection <modAssetWorkQty>(); //Execute a query to read the categories string sql = string.Format("select a.asset_id,b.asset_name,a.acc_name,a.work_qty,a.remark,a.update_user,a.update_time from asset_work_qty a inner join asset_list b on a.asset_id=b.asset_id where a.acc_name='{0}' order by a.asset_id,a.acc_name", accname); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modAssetWorkQty model = new modAssetWorkQty(); model.AssetId = dalUtility.ConvertToString(rdr["asset_id"]); model.AssetName = dalUtility.ConvertToString(rdr["asset_name"]); model.AccName = dalUtility.ConvertToString(rdr["acc_name"]); model.WorkQty = dalUtility.ConvertToDecimal(rdr["work_qty"]); model.Remark = dalUtility.ConvertToString(rdr["remark"]); model.UpdateUser = dalUtility.ConvertToString(rdr["update_user"]); model.UpdateTime = dalUtility.ConvertToDateTime(rdr["update_time"]); modellist.Add(model); } } emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
public void Test_Create_Empty_Collection() { IBindingCollection collection = new BindingCollection(); Assert.Equal(0, collection.TypeCount); Assert.Equal(0, collection.BindingCount); }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { var ctx = value as CommandContext; if (ctx == null) return null; BindingCollection<object> result = new BindingCollection<object>(); ctx.PropertyChanged += (s, e) => result.Load(Load(ctx)); result.Load(Load(ctx)); return result; }
internal Binding(string protocol, string bindingInformation, byte[] hash, string store, SslFlags flags, BindingCollection parent) : base(null, "binding", null, parent, null, null) { BindingInformation = bindingInformation; Protocol = protocol; CertificateHash = hash; CertificateStoreName = store; SslFlags = flags; Parent = parent; }
/// <summary> /// Initializes a new instance of the <see cref="MultiBinding"/> class. /// </summary> public MultiBinding() { Bindings = new BindingCollection (); _curBindingCount = 0; }
public Binding(ConfigurationElement element, BindingCollection parent) : base(element, null, null, parent, null, null) { Parent = parent; }
public static ArrayList GetAllBindings(BindingCollection bindings) { ArrayList list = new ArrayList(); int num = 0; foreach (Binding binding in bindings) { PropertyBag bag = new PropertyBag(); bag[FtpSiteGlobals.BindingProtocol] = binding.Protocol; bag[FtpSiteGlobals.BindingInformation] = binding.BindingInformation; bag[FtpSiteGlobals.BindingIndex] = num; list.Add(bag); num++; } return list; }
public static ArrayList GetFtpBindings(BindingCollection bindings) { ArrayList list = new ArrayList(); foreach (Binding binding in bindings) { if (string.Equals(binding.Protocol.Trim(), "ftp", StringComparison.OrdinalIgnoreCase)) { list.Add(binding.BindingInformation); } } return list; }
private List<IPBindingDesiredState> GetBindings(BindingCollection bindings) { var siteBindingList = new List<IPBindingDesiredState>(); foreach (var binding in bindings) { if (binding.Protocol.ToLower().StartsWith("http")) { var b = new IPBindingDesiredState(binding); siteBindingList.Add(b); } } return siteBindingList; }
//----------------------------------------------------- // // Constructors // //----------------------------------------------------- /// <summary> Constructor </summary> public PriorityBinding() : base() { _bindingCollection = new BindingCollection(this, new BindingCollectionChangedCallback(OnBindingCollectionChanged)); }
//----------------------------------------------------- // // Constructors // //----------------------------------------------------- /// <summary> Default constructor </summary> public MultiBinding() { _bindingCollection = new BindingCollection(this, new BindingCollectionChangedCallback(OnBindingCollectionChanged)); }
//-------------------------------------------------------------- /// <summary> /// Initializes a new instance of the <see cref="MultiBinding"/> class. /// </summary> public MultiBinding() { Bindings = new BindingCollection(); }
public void ModificarUsuario(string p, BindingCollection.UsuarioView user) { throw new NotImplementedException(); }
void DoBindings (IScriptObject owner, BindingCollection bindings) { Assert.AreEqual (owner, ((IScriptObject)bindings).Owner, "A4"); Assert.AreEqual (0, bindings.Count, "b1"); Assert.AreEqual ("", ((IScriptObject)bindings).ID, "b2"); }
/// <summary> /// Unbinds any bindings in the <see cref="Bindings"/> collection and removes the bindings /// </summary> public virtual void Unbind () { if (bindings != null) { bindings.Unbind(); bindings = null; } }