protected void btSave_Click(object sender, EventArgs e) { SchedulingInfo info = new SchedulingInfo(); SchedulingInfoBLL bll = null; try { UIBindHelper.BindModelByControls(this.Page, info); bll = BLLFactory.CreateBLL <SchedulingInfoBLL>(); if (this.hiID.Value == "") { bll.Insert(info); } else { info.CREATEUSER = this.HiCREATEUSER.Value; info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value); info.PID = this.hiID.Value; bll.Update(info); } ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.refreshData();parent.closeAppWindow1();", true); } catch (Exception ex) { throw ex; } }
private void BindData() { string id = Request.QueryString["id"]; SchedulingInfoBLL bll = null; SchedulingInfo info = new SchedulingInfo(); try { bll = BLLFactory.CreateBLL <SchedulingInfoBLL>(); if (string.IsNullOrEmpty(id) == false) { info.PID = id; info = bll.Get(info); UIBindHelper.BindForm(this.Page, info); this.hiID.Value = info.PID; this.HiCREATEUSER.Value = info.CREATEUSER; this.HiCREATETIME.Value = info.CREATETIME.ToString(); } else { info = new SchedulingInfo(); } } catch (Exception ex) { throw ex; } }
/// <summary> /// 获取列表 /// </summary> /// <param name="condition">条件</param> /// <param name="page">数据页</param> /// <returns>数据页</returns> public DataPage GetList(SchedulingInfo condition, DataPage page) { string sql = null; List <DataParameter> parameters = new List <DataParameter>(); try { sql = this.GetQuerySql(condition, ref parameters); //分页关键字段及排序 page.KeyName = "PID"; if (string.IsNullOrEmpty(page.SortExpression)) { page.SortExpression = "UPDATETIME DESC"; } using (IDataSession session = AppDataFactory.CreateMainSession()) { page = session.GetDataPage <SchedulingInfo>(sql, parameters.ToArray(), page); } return(page); } catch (Exception ex) { throw ex; } }
private void BindData() { SchedulingInfoBLL bll = null; DataPage dp = new DataPage(); SchedulingInfo condition = new SchedulingInfo(); try { bll = BLLFactory.CreateBLL <SchedulingInfoBLL>(); condition.FAID = this.FAID.Text; condition.PRID = this.PRID.Text; condition.WOID = this.WOID.Text; PagerHelper.InitPageControl(this.AspNetPager1, dp, true); dp = bll.GetList(condition, dp); List <SchedulingInfo> list = dp.Result as List <SchedulingInfo>; this.GvList.DataSource = list; this.GvList.DataBind(); for (int i = 0; i < this.GvList.Rows.Count; i++) { string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["PID"].ToString()); (this.GvList.Rows[i].Cells[9].Controls[0] as WebControl).Attributes.Add("onclick", click); } PagerHelper.SetPageControl(AspNetPager1, dp, true); } catch (Exception ex) { throw ex; } }
/// <summary> /// 获取列表 /// </summary> /// <param name="condition">条件</param> /// <param name="page">数据页</param> /// <returns>数据页</returns> public DataPage GetList(SchedulingInfo condition, DataPage page) { try { return(new SchedulingInfoDAL().GetList(condition, page)); } catch (Exception ex) { throw ex; } }
/// <summary> /// 获取信息 /// </summary> /// <param name="">条件</param> /// <returns>信息</returns> public SchedulingInfo Get(SchedulingInfo model) { try { return(new SchedulingInfoDAL().Get(model)); } catch (Exception ex) { throw ex; } }
/// <summary> /// 删除信息 /// </summary> /// <param name="">信息</param> /// <returns>删除个数</returns> public int DeleteSchedulingInfo(SchedulingInfo model) { try { return(new SchedulingInfoDAL().Delete(model)); } catch (Exception ex) { throw ex; } }
/// <summary> /// 更新信息 /// </summary> /// <param name="">信息</param> /// <returns>更新行数</returns> public DataResult <int> Update(SchedulingInfo model) { DataResult <int> result = new DataResult <int>(); try { model.UPDATEUSER = this.LoginUser.UserID; result.Result = new SchedulingInfoDAL().Update(model); result.IsSuccess = true; return(result); } catch (Exception ex) { throw ex; } }
/// <summary> /// 获取信息 /// </summary> /// <param name="">条件</param> /// <returns>*信息</returns> public SchedulingInfo Get(SchedulingInfo model) { try { using (IDataSession session = AppDataFactory.CreateMainSession()) { //获取信息 model = session.Get <SchedulingInfo>(model); } return(model); } catch (Exception ex) { throw ex; } }
/// <summary> /// 删除信息 /// </summary> /// <param name=""></param> /// <returns>删除个数</returns> public int Delete(SchedulingInfo model) { int count = 0; try { using (IDataSession session = AppDataFactory.CreateMainSession()) { //删除基本信息 count = session.Delete <SchedulingInfo>(model); } return(count); } catch (Exception ex) { throw ex; } }
/// <summary> /// 获取查询语句 /// </summary> /// <param name="user">查询条件</param> /// <param name="parameters">参数</param> /// <returns>查询语句</returns> private string GetQuerySql(SchedulingInfo condition, ref List <DataParameter> parameters) { StringBuilder sqlBuilder = new StringBuilder(); StringBuilder whereBuilder = new StringBuilder(); try { //构成查询语句 sqlBuilder.Append(@"SELECT t1.*,t2.PNAME as FNAME,t3.PLNAME as PLNAME,t4.PNAME AS WNAME FROM T_FP_SCHEDULING t1 LEFT OUTER JOIN T_FP_FACTORYINFO t2 on t1.FAID = t2.PID LEFT OUTER JOIN T_FP_PRODUCTLINE t3 on t1.PRID = t3.PID LEFT OUTER JOIN T_FP_WORKGROUP t4 on t1.WOID = t4.PID"); if (!string.IsNullOrEmpty(condition.FAID)) { whereBuilder.Append(" AND t2.PNAME like @FAID"); parameters.Add(new DataParameter("FAID", "%" + condition.FAID + "%")); } if (!string.IsNullOrEmpty(condition.PRID)) { whereBuilder.Append(" AND t2.PLNAME like @PRID"); parameters.Add(new DataParameter("PRID", "%" + condition.PRID + "%")); } if (!string.IsNullOrEmpty(condition.WOID)) { whereBuilder.Append(" AND t4.PNAME like @WOID"); parameters.Add(new DataParameter("WOID", "%" + condition.WOID + "%")); } //查询条件 if (whereBuilder.Length > 0) { sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4)); } return(sqlBuilder.ToString()); } catch (Exception ex) { throw ex; } }
/// <summary> /// 插入信息(单表) /// </summary> /// <param name="">信息</param> /// <returns>插入行数</returns> public DataResult <int> Insert(SchedulingInfo model) { DataResult <int> result = new DataResult <int>(); try { //基本信息 model.PID = Guid.NewGuid().ToString(); model.CREATEUSER = this.LoginUser.UserID; model.CREATETIME = DateTime.Now; model.UPDATEUSER = model.CREATEUSER; model.UPDATETIME = model.CREATETIME; SchedulingInfoDAL cmdDAL = new SchedulingInfoDAL(); result.Result = new SchedulingInfoDAL().Insert(model); result.IsSuccess = true; return(result); } catch (Exception ex) { throw ex; } }
/// <summary> /// 获取导出的数据 /// </summary> /// <param name="user">查询条件</param> /// <returns>数据</returns> public DataTable GetExportData(SchedulingInfo model) { DataTable dt = null; string sql = null; List <DataParameter> parameters = new List <DataParameter>(); try { //构成查询语句 sql = this.GetQuerySql(model, ref parameters); using (IDataSession session = AppDataFactory.CreateMainSession()) { dt = session.GetTable(sql, parameters.ToArray()); dt.TableName = "SchedulingInfo"; } return(dt); } catch (Exception ex) { throw ex; } }
public XmlApi.dialingInfoType GetDialingInfo(icm.XmlApi.userType userInfo, SchedulingInfo schedulingInfo, icm.XmlApi.virtualRoomType defaultVirtualRoom, bool isCreate, bool isDelete) { if (userInfo == null) throw new ArgumentNullException("userInfo"); if (userInfo.UserId == null) throw new ArgumentNullException("number"); string accessPIN = schedulingInfo.meetingPin; XmlApi.getDialingInfoRequestType request = new XmlApi.getDialingInfoRequestType(); request.MemberId = userInfo.MemberId; request.ItemElementName = XmlApi.ItemChoiceType5.UserId; request.Item = userInfo.UserId; if (!string.IsNullOrEmpty(accessPIN)) request.AccessPIN = Encoding.UTF8.GetBytes(accessPIN); else request.AccessPIN = defaultVirtualRoom.AccessPIN; if (null != defaultVirtualRoom.ServicePrefix) request.servicePrefix = defaultVirtualRoom.ServicePrefix; if (null != defaultVirtualRoom.ServiceTemplateId) request.ServiceTemplateId = defaultVirtualRoom.ServiceTemplateId; if (isCreate) { request.operation = XmlApi.operationPolicyType.CREATE; } else { request.operation = XmlApi.operationPolicyType.MODIFY; } if (isDelete) { request.operation = XmlApi.operationPolicyType.CANCEL; } request.operationSpecified = true; XmlApi.getDialingInfoResponseType response = this._Connector.Request(request) as XmlApi.getDialingInfoResponseType; return response != null ? response.DialingInfo : null; }
public XmlApi.scheduleReportType CancelConference(SchedulingInfo schedulingInfo, bool deleteClientlessMapping) { if (string.IsNullOrEmpty(schedulingInfo.conferenceID)) throw new ArgumentException( "Conference ID cannot be null or empty." ); XmlApi.cancelConferenceRequestType request = new XmlApi.cancelConferenceRequestType(); request.ConferenceId = schedulingInfo.conferenceID; request.Reccuring = schedulingInfo.meetingType == MeetingType.Reccurence; request.ClientSpecified = true; request.Client = XmlApi.clientType.OUTLOOK_CLIENTLESS; request.DeleteClientLessConfIDMapping = deleteClientlessMapping; if (schedulingInfo.meetingType == MeetingType.Ocurrence) { request.StartTime = ((DateTime)schedulingInfo.startDate).ToUniversalTime(); request.StartTimeSpecified = true; } XmlApi.cancelConferenceResponseType response = this._Connector.Request( request ) as XmlApi.cancelConferenceResponseType; return response != null ? response.Report : null; }