private void InitContent() { try { var jo = TableData.TableDataHelper.ReadTable(Enums.TableType.Content); if (jo != null) { JavaScriptSerializer Serializer = new JavaScriptSerializer(); BindingCollection <EBContentTMP> EBContent_ListTMP = Serializer.Deserialize <BindingCollection <EBContentTMP> >(jo["0"].ToString()); BindingCollection <EBContent> EBContent_ListTMP2 = JsonConvert.DeserializeObject <BindingCollection <EBContent> >(jo["1"].ToString()); if (EBContent_ListTMP != null) { foreach (EBContentTMP item in EBContent_ListTMP) { EBContent_AllData tmp = new EBContent_AllData(); tmp.Guid = item.Guid; tmp.SectionName = item.SectionName; tmp.SendState = item.SendState; tmp.EBM_ID = item.EBM_ID; tmp.EBContentList = GetRelateEBContentlist(tmp.Guid, tmp.EBM_ID, EBContent_ListTMP2); EBContent_List_AllData.Add(tmp); } } } } catch (Exception) { throw; } }
/// <summary> /// 增加Section /// </summary> private void AddSection() { try { if (cbBoxEBMId.SelectedValue != null) { if (dgvEBContent.Rows.Count == 0) { string EBM_ID = cbBoxEBMId.SelectedValue.ToString(); EBMContentSectionInfo form = new EBMContentSectionInfo(Enums.OperateType.Add, EBM_ID); DialogResult result = form.ShowDialog(); if (result == DialogResult.OK && form.ContentAllData != null) { SelectEBContent_List.Add(form.ContentAllData); EBContent_List_AllData.Add(form.ContentAllData);//同步到全局数据 } form.Dispose(); } else { MessageBox.Show("已添加过一条数据,不能再添加!"); } } else { MessageBox.Show("未发现可用EBM_ID"); } } catch (Exception) { throw; } }
/// <summary> /// get all accreceivablelist /// <summary> /// <param name=accname>accname</param> /// <param name=custid>custid</param> /// <param name=out emsg>return error message</param> ///<returns>details of all accreceivablelist</returns> public BindingCollection <modAccReceivableList> GetIList(string accname, string custid, out string emsg) { try { BindingCollection <modAccReceivableList> modellist = new BindingCollection <modAccReceivableList>(); //Execute a query to read the categories string sql = string.Format("select a.id,a.acc_name,a.seq,a.acc_date,a.cust_id,b.cust_name,a.currency,a.exchange_rate,a.start_mny,a.adding_mny,a.paid_mny,a.form_id,a.form_type,a.remark,a.update_user,a.update_time " + "from acc_receivable_list a inner join customer_list b on a.cust_id=b.cust_id where a.acc_name='{0}' and a.cust_id='{1}' order by a.id", accname, custid); decimal totalstart = 0; decimal totaladding = 0; decimal totalpaid = 0; modAccReceivableList model; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { model = new modAccReceivableList(); model.Id = dalUtility.ConvertToInt(rdr["id"]); model.AccName = dalUtility.ConvertToString(rdr["acc_name"]); model.Seq = dalUtility.ConvertToInt(rdr["seq"]); model.AccDate = dalUtility.ConvertToDateTime(rdr["acc_date"]); 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.StartMny = dalUtility.ConvertToDecimal(rdr["start_mny"]); model.AddingMny = dalUtility.ConvertToDecimal(rdr["adding_mny"]); model.PaidMny = dalUtility.ConvertToDecimal(rdr["paid_mny"]); model.FormId = dalUtility.ConvertToString(rdr["form_id"]); model.FormType = dalUtility.ConvertToString(rdr["form_type"]); model.Remark = dalUtility.ConvertToString(rdr["remark"]); model.UpdateUser = dalUtility.ConvertToString(rdr["update_user"]); model.UpdateTime = dalUtility.ConvertToDateTime(rdr["update_time"]); modellist.Add(model); totalstart += model.StartMny * model.ExchangeRate; totaladding += model.AddingMny * model.ExchangeRate; totalpaid += model.PaidMny * model.ExchangeRate; } } model = new modAccReceivableList(); model.AccName = accname; model.CustId = "合计"; model.CustName = "合计"; model.Currency = "人民币"; model.ExchangeRate = 1; model.StartMny = totalstart; model.AddingMny = totaladding; model.PaidMny = totalpaid; model.EndMny = totalstart + totaladding - totalpaid; modellist.Add(model); emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
public void InitData(List <EBMContent.Auxiliary> list) { foreach (var data in list) { bindList.Add(data); } dgvAuxiliaryData.DataSource = bindList; }
/// <summary> /// get all accotherpayable /// <summary> /// <param name=out emsg>return error message</param> ///<returns>details of all accotherpayable</returns> public BindingCollection <modAccOtherPayable> GetIList(string accname, string objectname, out string emsg) { try { BindingCollection <modAccOtherPayable> modellist = new BindingCollection <modAccOtherPayable>(); //Execute a query to read the categories string sql = string.Format("select id,acc_name,seq,acc_date,object_name,currency,exchange_rate,start_mny,adding_mny,paid_mny,form_id,form_type,remark,update_user,update_time from acc_other_payable where acc_name='{0}' and object_name='{1}' order by id", accname, objectname); decimal totalstart = 0; decimal totaladding = 0; decimal totalpaid = 0; modAccOtherPayable model; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { model = new modAccOtherPayable(); model.Id = dalUtility.ConvertToInt(rdr["id"]); model.AccName = dalUtility.ConvertToString(rdr["acc_name"]); model.Seq = dalUtility.ConvertToInt(rdr["seq"]); model.AccDate = dalUtility.ConvertToDateTime(rdr["acc_date"]); model.ObjectName = dalUtility.ConvertToString(rdr["object_name"]); model.Currency = dalUtility.ConvertToString(rdr["currency"]); model.ExchangeRate = dalUtility.ConvertToDecimal(rdr["exchange_rate"]); model.StartMny = dalUtility.ConvertToDecimal(rdr["start_mny"]); model.AddingMny = dalUtility.ConvertToDecimal(rdr["adding_mny"]); model.PaidMny = dalUtility.ConvertToDecimal(rdr["paid_mny"]); model.FormId = dalUtility.ConvertToString(rdr["form_id"]); model.FormType = dalUtility.ConvertToString(rdr["form_type"]); model.Remark = dalUtility.ConvertToString(rdr["remark"]); model.UpdateUser = dalUtility.ConvertToString(rdr["update_user"]); model.UpdateTime = dalUtility.ConvertToDateTime(rdr["update_time"]); modellist.Add(model); } } model = new modAccOtherPayable(); model.AccName = accname; model.ObjectName = "合计"; model.Currency = "人民币"; model.ExchangeRate = 1; model.StartMny = totalstart; model.AddingMny = totaladding; model.PaidMny = totalpaid; model.EndMny = totalstart + totaladding - totalpaid; modellist.Add(model); emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
/// <summary> /// get customer receivable summary /// <summary> /// <param name=accname>accname</param> /// <param name=out emsg>return error message</param> ///<returns>details of all accreceivablelist</returns> public BindingCollection <modCustReceivableSummary> GetCustReceivableSummary(string accname, out string emsg) { try { BindingCollection <modCustReceivableSummary> modellist = new BindingCollection <modCustReceivableSummary>(); //Execute a query to read the categories string sql = string.Format("select a.acc_name,a.cust_id,b.cust_name,a.currency,a.exchange_rate,sum(a.start_mny) start_mny,sum(a.adding_mny) adding_mny,sum(a.paid_mny) paid_mny from acc_receivable_list a inner join customer_list b on a.cust_id=b.cust_id where a.acc_name='{0}' group by a.acc_name,a.cust_id,b.cust_name,a.currency,a.exchange_rate", accname); decimal totalstart = 0; decimal totaladding = 0; decimal totalpaid = 0; modCustReceivableSummary model; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { model = new modCustReceivableSummary(); model.AccName = dalUtility.ConvertToString(rdr["acc_name"]); 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.StartMny = dalUtility.ConvertToDecimal(rdr["start_mny"]); model.AddingMny = dalUtility.ConvertToDecimal(rdr["adding_mny"]); model.PaidMny = dalUtility.ConvertToDecimal(rdr["paid_mny"]); model.EndMny = model.StartMny + model.AddingMny - model.PaidMny; modellist.Add(model); totalstart += model.StartMny * model.ExchangeRate; totaladding += model.AddingMny * model.ExchangeRate; totalpaid += model.PaidMny * model.ExchangeRate; } } model = new modCustReceivableSummary(); model.AccName = accname; model.CustId = "合计"; model.CustName = "合计"; model.Currency = "人民币"; model.ExchangeRate = 1; model.StartMny = totalstart; model.AddingMny = totaladding; model.PaidMny = totalpaid; model.EndMny = totalstart + totaladding - totalpaid; modellist.Add(model); emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
/// <summary> /// get all already granted data /// <summary> /// <param name=roleid>roleid</param> ///<returns>Details about all TaskGrant</returns> public BindingCollection <modTaskGrant> GetAllUserTask(string userid, out string emsg) { try { dalUserList daluser = new dalUserList(); modUserList moduser = daluser.GetItem(userid); BindingCollection <modTaskGrant> modellist = new BindingCollection <modTaskGrant>(); string sql = string.Format("select a.task_code,b.task_name,b.form_name,b.group_id,b.task_type,b.url,b.web_url from sys_task_grant a,sys_task_list b where a.task_code=b.task_code and a.role_id= '{0}' and b.status=1 order by a.task_code", userid); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modTaskGrant model = new modTaskGrant(); model.TaskCode = rdr["task_code"].ToString(); model.TaskName = rdr["task_name"].ToString(); model.TaskType = rdr["task_type"].ToString(); model.FormName = rdr["form_name"].ToString(); model.GroupId = rdr["group_id"].ToString(); model.Url = rdr["url"].ToString(); model.WebUrl = rdr["web_url"].ToString(); model.Checked = true; modellist.Add(model); } } sql = string.Format("select a.task_code,a.task_name,a.form_name,a.group_id,a.task_type,a.url,a.web_url from sys_task_list a where a.status=1 and not exists (select '#' from sys_task_grant where task_code =a.task_code and (role_id='{0}' or role_id='{1}'))", moduser.RoleId, userid); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modTaskGrant model = new modTaskGrant(); model.TaskCode = rdr["task_code"].ToString(); model.TaskName = rdr["task_name"].ToString(); model.TaskType = rdr["task_type"].ToString(); model.FormName = rdr["form_name"].ToString(); model.GroupId = rdr["group_id"].ToString(); model.Url = rdr["url"].ToString(); model.WebUrl = rdr["web_url"].ToString(); model.Checked = false; modellist.Add(model); } } emsg = string.Empty; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
private void LoadLogs(DateTable log) { try { DateTable.Add(log); if (DateList.SelectedRows.Count == 0) { DateList.Rows[0].Selected = true; } } catch { // ignored } }
/// <summary> /// get all customerlevel /// <summary> /// <param name=custlevel>custlevel</param> /// <param name=out emsg>return error message</param> ///<returns>details of all customerlevel</returns> public BindingCollection <modCustomerLevel> GetIList(string getwhere, out string emsg) { try { BindingCollection <modCustomerLevel> modellist = new BindingCollection <modCustomerLevel>(); //Execute a query to read the categories string sql = "select cust_level,description,status,update_user,update_time from customer_level where 1=1 " + getwhere + " order by cust_level"; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modCustomerLevel model = new modCustomerLevel(); model.CustLevel = dalUtility.ConvertToString(rdr["cust_level"]); model.Description = dalUtility.ConvertToString(rdr["description"]); model.Status = dalUtility.ConvertToInt(rdr["status"]); 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 DailyBroadcast_FormClosing(object sender, FormClosingEventArgs e) { ChangeProgram_List.Clear(); PlayCtrl_List.Clear(); OutSwitch_List.Clear(); RdsTransfer_List.Clear(); foreach (var daily in TotalConfig_List) { switch (daily.B_Daily_cmd_tag) { case ChangeProgramTag: ChangeProgram_List.Add(daily as ChangeProgram); break; case PlayCtrlTag: PlayCtrl_List.Add(daily as PlayCtrl); break; case OutSwitchTag: OutSwitch_List.Add(daily as OutSwitch); break; case RdsTransferTag: RdsTransfer_List.Add(daily as RdsTransfer); break; } } TableData.TableDataHelper.WriteTable(Enums.TableType.DailyBroadcast, ChangeProgram_List, PlayCtrl_List, OutSwitch_List, RdsTransfer_List); }
/// <summary> /// get all quotationdetail /// <summary> /// <param name=formid>formid</param> /// <param name=out emsg>return error message</param> ///<returns>details of all quotationdetail</returns> public BindingCollection <modQuotationDetail> GetDetail(string formid, out string emsg) { try { BindingCollection <modQuotationDetail> modellist = new BindingCollection <modQuotationDetail>(); //Execute a query to read the categories string sql = string.Format("select form_id,seq,product_id,product_name,specify,brand,unit_no,qty,price,remark from quotation_detail where form_id='{0}' order by form_id,seq", formid); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modQuotationDetail model = new modQuotationDetail(); 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.Brand = dalUtility.ConvertToString(rdr["brand"]); model.UnitNo = dalUtility.ConvertToString(rdr["unit_no"]); model.Qty = dalUtility.ConvertToDecimal(rdr["qty"]); model.Price = dalUtility.ConvertToDecimal(rdr["price"]); model.Mny = model.Qty * model.Price; model.Remark = dalUtility.ConvertToString(rdr["remark"]); modellist.Add(model); } } emsg = null; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
/// <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); } }
public static string AddBindings(string siteToAddBinding, string BindingToAdd, string Proto) { ServerManager iisManager = new ServerManager(); var site = iisManager.Sites[siteToAddBinding]; BindingCollection biningCollection = site.Bindings; Binding binding = site.Bindings.CreateElement("binding"); binding["protocol"] = Proto; var port = 80; if (Proto.ToLower() == "https") { port = 443; } binding["bindingInformation"] = $"*:{port}:{BindingToAdd}"; foreach (var bindingInfo in biningCollection) { if (bindingInfo.BindingInformation == binding["bindingInformation"].ToString()) { return("Binding Exists: " + binding["bindingInformation"].ToString()); } } biningCollection.Add(binding); iisManager.CommitChanges(); return("Binding added: " + binding["bindingInformation"].ToString()); }
/// <summary> /// get all sysuserprivilege /// <summary> /// <param name=userid>userid</param> /// <param name=out emsg>return error message</param> ///<returns>details of all sysuserprivilege</returns> public BindingCollection <modSysUserPrivilege> GetIList(string userid, out string emsg) { try { BindingCollection <modSysUserPrivilege> modellist = new BindingCollection <modSysUserPrivilege>(); //Execute a query to read the categories string sql = string.Format("select user_id,privilege_name,privilege_value,update_user,update_time from sys_user_privilege where user_id='{0}' order by user_id,privilege_name", userid); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modSysUserPrivilege model = new modSysUserPrivilege(); model.UserId = dalUtility.ConvertToString(rdr["user_id"]); model.PrivilegeName = dalUtility.ConvertToString(rdr["privilege_name"]); model.PrivilegeValue = dalUtility.ConvertToString(rdr["privilege_value"]); 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 task group /// <summary> /// <param name=validonly>validonly</param> ///<returns>Details about all TaskGroup</returns> public BindingCollection <modTaskGroup> GetIList(bool validonly, out string emsg) { try { string sql; string getwhere = validonly == true ? "and status=1" : string.Empty; sql = "select group_id,group_desc,status,seq,update_user,update_time from sys_task_group where 1=1 " + getwhere + "order by seq"; BindingCollection <modTaskGroup> modellist = new BindingCollection <modTaskGroup>(); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modTaskGroup model = new modTaskGroup(); model.GroupId = dalUtility.ConvertToString(rdr["group_id"]); model.GroupDesc = dalUtility.ConvertToString(rdr["group_id"]); model.Status = dalUtility.ConvertToInt(rdr["status"]); model.Seq = dalUtility.ConvertToInt(rdr["seq"]); model.UpdateUser = dalUtility.ConvertToString(rdr["update_user"]); model.UpdateTime = dalUtility.ConvertToDateTime(rdr["update_time"]); modellist.Add(model); } } emsg = ""; return(modellist); } catch (Exception ex) { emsg = dalUtility.ErrorMessage(ex.Message); return(null); } }
private void AddRoom(long roomId, bool isSave = false) { var room = new Rooms(roomId); room.Refresh().ContinueWith(task => { if (task.IsFaulted) { MessageBox.Show(room.Message, @"错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } MainList.Invoke(new Action(() => { if (_table.All(x => x.RealRoomID != room.RealRoomID)) { _table.Add(room); Table.Add(room); AddCheckRoomStatusTask(room); if (isSave) { SaveConfig(); } NewRoomId.Clear(); } else { MessageBox.Show($@"已添加房间 {room.RealRoomID}", @"提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } })); }); }
/// <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> /// 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 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 vendortype /// <summary> /// <param name=vendortype>vendortype</param> /// <param name=out emsg>return error message</param> ///<returns>details of all vendortype</returns> public BindingCollection <modVendorType> GetIList(string vendortype, out string emsg) { try { BindingCollection <modVendorType> modellist = new BindingCollection <modVendorType>(); //Execute a query to read the categories string sql = string.Format("select vendor_type,status,update_user,update_time from vendor_type where vendor_type='{0}' order by vendor_type", vendortype); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modVendorType model = new modVendorType(); model.VendorType = dalUtility.ConvertToString(rdr["vendor_type"]); model.Status = dalUtility.ConvertToInt(rdr["status"]); 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 admindeptlist /// <summary> /// <param name=deptid>deptid</param> /// <param name=out emsg>return error message</param> ///<returns>details of all admindeptlist</returns> public BindingCollection <modAdminDeptList> GetIList(string deptid, out string emsg) { try { BindingCollection <modAdminDeptList> modellist = new BindingCollection <modAdminDeptList>(); //Execute a query to read the categories string sql = string.Format("select dept_id,dept_desc,status,update_user,update_time from admin_dept_list where dept_id='{0}' order by dept_id", deptid); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modAdminDeptList model = new modAdminDeptList(); model.DeptId = dalUtility.ConvertToString(rdr["dept_id"]); model.DeptDesc = dalUtility.ConvertToString(rdr["dept_desc"]); model.Status = dalUtility.ConvertToInt(rdr["status"]); 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 otherreceivableobject /// <summary> /// <param name=objectname>objectname</param> /// <param name=out emsg>return error message</param> ///<returns>details of all otherreceivableobject</returns> public BindingCollection <modOtherReceivableObject> GetIList(string objectname, out string emsg) { try { BindingCollection <modOtherReceivableObject> modellist = new BindingCollection <modOtherReceivableObject>(); //Execute a query to read the categories string sql = string.Format("select object_name,status,currency,link_man,addr,tel,remark,update_user,update_time from other_receivable_object where object_name='{0}' order by object_name", objectname); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modOtherReceivableObject model = new modOtherReceivableObject(); model.ObjectName = dalUtility.ConvertToString(rdr["object_name"]); model.Status = dalUtility.ConvertToInt(rdr["status"]); model.Currency = dalUtility.ConvertToString(rdr["currency"]); model.LinkMan = dalUtility.ConvertToString(rdr["link_man"]); model.Addr = dalUtility.ConvertToString(rdr["addr"]); model.Tel = dalUtility.ConvertToString(rdr["tel"]); 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); } }
/// <summary> /// get all remarklist /// <summary> /// <param name=remarktype>remarktype</param> /// <param name=out emsg>return error message</param> ///<returns>details of all remarklist</returns> public BindingCollection <modRemarkList> GetIList(string remarktype, out string emsg) { try { BindingCollection <modRemarkList> modellist = new BindingCollection <modRemarkList>(); //Execute a query to read the categories string sql = string.Format("select remark_type,remark,update_user,update_time from remark_list where remark_type='{0}' order by remark_type,remark", remarktype); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modRemarkList model = new modRemarkList(); model.RemarkType = dalUtility.ConvertToString(rdr["remark_type"]); 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); } }
/// <summary> /// get all unitlist /// <summary> /// <param name=validonly>status is valid</param> /// <param name=out emsg>return error message</param> ///<returns>details of all unitlist</returns> public BindingCollection <modUnitList> GetIList(bool validonly, out string emsg) { try { BindingCollection <modUnitList> modellist = new BindingCollection <modUnitList>(); //Execute a query to read the categories string getwhere = validonly == true ? "and status=1" : string.Empty; string sql = "select unit_no,status,update_user,update_time from unit_list where 1=1 " + getwhere + "order by unit_no"; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modUnitList model = new modUnitList(); model.UnitNo = dalUtility.ConvertToString(rdr["unit_no"]); model.Status = dalUtility.ConvertToInt(rdr["status"]); 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 init payable /// <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 <modStartOtherPayable> GetStartOtherPayable(string accname, string currency, decimal exchange_rate, out string emsg) { try { BindingCollection <modStartOtherPayable> modellist = new BindingCollection <modStartOtherPayable>(); //Execute a query to read the categories //string sql = string.Format("a.object_name,isnull(b.start_mny,1) start_mny,isnull(b.exchange_rate,0) exchange_rate from other_payable_object a left join acc_other_payable b on a.object_name=b.object_name where b.acc_name='{0}' and b.currency='{1}'", accname, currency); string sql = string.Format("select a.object_name,isnull(b.start_mny,0) start_mny from other_payable_object a left join " + "(select object_name,currency,start_mny,exchange_rate from acc_other_payable where acc_name='{0}' and seq=0 and currency='{1}') b on a.object_name=b.object_name where a.currency='{2}'", accname, currency, currency); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modStartOtherPayable model = new modStartOtherPayable(); model.AccName = accname; model.ObjectName = dalUtility.ConvertToString(rdr["object_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); } }
public BindingCollection <TagEntity> GetRequestTags(string requestId) { _logger.Debug("GetRequestTags."); if (string.IsNullOrEmpty(requestId)) { throw new ArgumentNullException("RequestId param can not be null."); } _logger.Debug("Params: requestId = {0};", requestId.ToString()); BindingCollection <TagEntity> result = new BindingCollection <TagEntity>(); OraCommand command = new OraCommand("REQ_PKG.SEL_REQ_TAG"); command.CommandType = CommandType.StoredProcedure; command.AddDBParam(new OraParamInt32("p_req_id", ParameterDirection.Input, Convert.ToInt32(requestId))); OraParamRefCursor refCur = new OraParamRefCursor("p_reqTag_cr", ParameterDirection.Output); command.AddDBParam(refCur); Execute(command); if (refCur.ParamValue != null) { foreach (DataRow reqRow in refCur.ParamValue.Rows) { result.Add(ToTag(reqRow)); } } return(result); }
/// <summary> /// get all logloginhost /// <summary> /// <param name=out emsg>return error message</param> ///<returns>details of all logloginhost</returns> public BindingCollection <modLogLoginHost> GetIList(out string emsg) { try { BindingCollection <modLogLoginHost> modellist = new BindingCollection <modLogLoginHost>(); //Execute a query to read the categories string sql = "select host_name,host_code,register_code,update_user,update_time from log_login_host order by host_name"; using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modLogLoginHost model = new modLogLoginHost(); model.HostName = dalUtility.ConvertToString(rdr["host_name"]); model.HostCode = dalUtility.ConvertToString(rdr["host_code"]); model.RegisterCode = dalUtility.ConvertToString(rdr["register_code"]); 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 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); } }
/// <summary> /// get all unitlist /// <summary> /// <param name=unitno>unitno</param> /// <param name=out emsg>return error message</param> ///<returns>details of all unitlist</returns> public BindingCollection <modUnitList> GetIList(string unitno, out string emsg) { try { BindingCollection <modUnitList> modellist = new BindingCollection <modUnitList>(); //Execute a query to read the categories string sql = string.Format("select unit_no,status,update_user,update_time from unit_list where unit_no='{0}' order by unit_no", unitno); using (SqlDataReader rdr = SqlHelper.ExecuteReader(sql)) { while (rdr.Read()) { modUnitList model = new modUnitList(); model.UnitNo = dalUtility.ConvertToString(rdr["unit_no"]); model.Status = dalUtility.ConvertToInt(rdr["status"]); 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 InitView() { _appList = _nsiService.Applications; _appList.Add(AppEntity.Create()); _orgList = _nsiService.Organizations; _orgList.Add(OrgEntity.Create()); _userList = _nsiService.Users; _userList.Add(UserEntity.Create()); _tagList = _nsiService.Tags; _dialogResult = null; _control = new RequestFilterControl(this); _caption = string.Format("Параметри пошуку звернень", ""); _hint = string.Format("Параметри пошуку звернень", ""); _image = Properties.Resources.Request; _filterList = new List <RequestListFilterEntity>(); foreach (RequestListFilterEntity filter in _mainController.Filters) { _filterList.Add(filter.Clone()); } if (_filterOrigin == null) { Filter = RequestListFilterEntity.Create(); } else { Filter = _filterOrigin.Clone(); } }