/// <summary> /// 设计表单 /// </summary> /// <returns></returns> public string DoDFrom() { string url = "/WF/MapDef/CCForm/Frm.aspx?FK_MapData=" + this.No + "&T=sd"; PubClass.WinOpen(url, 500, 550); return(null); }
/// <summary> /// 保存图片文件 /// </summary> /// <param name="flist"></param> private void CreateImg(List <Model.FlowerArrangement> flist) { try { string dir = Server.MapPath("/Upload/OrCodepic"); if (!System.IO.Directory.Exists(dir)) { // 目录不存在,建立目录 System.IO.Directory.CreateDirectory(dir); } DirectoryInfo theFolder = new DirectoryInfo(dir); //获得文件列表并按时间倒序 var fileInfo = theFolder.GetFiles().OrderByDescending(x => x.CreationTime); foreach (var item in fileInfo) { PubClass.FileDel(item.FullName); } for (int i = 0; i < flist.Count; i++) { string path = flist[i].ImgORCodePath; int index = path.IndexOf("."); string exc = path.Substring(index, path.Length - index); string filename = flist[i].OwnedCompany + flist[i].arrangement + flist[i].FlowerWatchName + exc;//获得图片的真实名字 string targetPath = dir + "/" + filename; string abpath = Server.MapPath("~") + path; System.IO.File.Copy(abpath, targetPath, true); } } catch (Exception ex) { throw; } }
public JsonResult Delete(int id, DateTime?CreateTime, FormCollection collection) { try { // TODO: Add delete logic here if (CreateTime != null) { list = client.GetBackUidList(id, CreateTime.Value); foreach (var item in list) { //删除文件夹中的图片 PubClass.FileDel(Server.MapPath(item.PictureOriginal)); client.Delete(item.Pid.ToString()); } } else { client.Delete(id.ToString()); } //删除文件夹中的图片 PubClass.FileDel(Server.MapPath(collection["PictureOriginal"])); return(Json(new { code = 0 })); } catch { return(Json(new { code = 1 })); } }
//計算分數 public void CalcScore(int intQutionNumber) { PubClass myClass = new PubClass(); bool blnCalcScore = myClass.CalcScore(intQutionNumber); Clients.All.calcScore(intQutionNumber, blnCalcScore); }
public string DoSetStartFlowDataSources() { string flowID = int.Parse(this.No).ToString() + "01"; PubClass.WinOpen("/WF/MapDef/MapExt.aspx?s=d34&FK_MapData=ND" + flowID + "&ExtType=StartFlow&RefNo==", 700, 500); return(null); }
/// <summary> /// 设计傻瓜表单 /// </summary> /// <returns></returns> public string DoDFromCol4() { string url = "../../Admin/FoolFormDesigner/Designer.htm?FK_MapData=" + this.No + "&IsFirst=1&UserNo=" + BP.Web.WebUser.No + "&SID=" + Web.WebUser.SID + "&AppCenterDBType=" + BP.DA.DBAccess.AppCenterDBType + "&CustomerNo=" + BP.Sys.SystemConfig.CustomerNo; PubClass.WinOpen(url, 800, 650); return(null); }
/// <summary> /// 打开pdf /// </summary> /// <returns></returns> public string DoOpenPDF() { string path = BP.Sys.Glo.Request.MapPath(this.Url); PubClass.OpenWordDocV2(path, this.FK_EmpT + "打印的" + this.FK_BillTypeT + ".pdf"); return(null); }
public string DoOpenPDF() { string path = System.Web.HttpContext.Current.Request.MapPath(this.Url); PubClass.OpenWordDocV2(path, this.FK_EmpT + "打印的" + this.FK_BillTypeT + ".pdf"); return(null); }
public ActionResult Chat(DataTable dtUserInfoTemp) { Models.UserInfo userInfo = new Models.UserInfo(); if (TempData["userInfo"] == null) { if (Session["LoginName"] == null) { return(RedirectToAction("Index", "Login")); } String userPhoneNumber = Session["LoginName"].ToString(); PubClass myClass = new PubClass(); DataTable dtUserInfo = myClass.GetUserInfoByPhoneNumber(userPhoneNumber); DataRow drRowUserInfo = dtUserInfo.Rows[0]; userInfo.userName = drRowUserInfo["userName"].ToString(); userInfo.phoneNumber = drRowUserInfo["phoneNumber"].ToString(); userInfo.job = drRowUserInfo["job"].ToString(); userInfo.jobIntroduction = drRowUserInfo["jobIntroduction"].ToString(); userInfo.imgPath = drRowUserInfo["imgPath"].ToString(); } else { userInfo = (Models.UserInfo)TempData["userInfo"]; } if (userInfo == null) { return(RedirectToAction("Index", "Login")); } return(View(userInfo)); }
/// <summary> /// 查看可以访问的人员 /// </summary> /// <returns></returns> public string DoWhoCanUseApp() { EmpInfoPushs eips = new EmpInfoPushs(); eips.ClearTable(); InfoPushs ens = new InfoPushs(); ens.RetrieveAllFromDBSource(); Emps emps = new Emps(); emps.RetrieveAll(); foreach (Emp emp in emps) { foreach (InfoPush info in ens) { EmpInfoPush em = new EmpInfoPush(); em.Copy(info); em.FK_Emp = emp.No; em.FK_InfoPush = info.No; em.MyPK = info.No + "_" + emp.No; em.Insert(); } } PubClass.WinOpen("/GPM/WhoCanViewInfoPush.aspx?FK_App=" + this.No, 500, 700); return(null); }
//回答問題 public void AnswerQuesiton(int intQutionNumber, String userName, String answer) { PubClass myClass = new PubClass(); bool blnAnswerQuestion = myClass.AnswerQuestion(intQutionNumber, userName, answer); Clients.Caller.answerQuesiton(intQutionNumber, blnAnswerQuestion); }
/// <summary> /// 导出表单 /// </summary> /// <returns></returns> public string DoExp() { string urlExt = "/WF/Admin/XAP/DoPort.aspx?DoType=DownFormTemplete&FK_MapData=" + this.No; PubClass.WinOpen(urlExt, 900, 1000); return(null); }
//取得分數板 public void GetScore() { PubClass myClass = new PubClass(); DataTable dtScore = myClass.GetScore(); String strJson = myClass.ConvertToJsonString(dtScore); Clients.All.getScore(strJson); }
//加入問題 public void AddQuesiton(int intQutionNumber) { PubClass myClass = new PubClass(); DataTable dtQuestion = myClass.GetQuestionByID(intQutionNumber); String Question = myClass.ConvertToJsonString(dtQuestion); Clients.All.addQuestion(Question); }
void ToolbarDDL_SelectedIndexChanged(object sender, EventArgs e) { if (this.SelectedItemStringVal == "...") { PubClass.Alert("hello"); return; } // throw new Exception("The method or operation is not implemented."); }
protected override bool beforeInsert() { if (string.IsNullOrEmpty(this.Name)) { throw new Exception("@请输入字段名称。"); } if (this.KeyOfEn == null || this.KeyOfEn.Trim() == "") { try { this.KeyOfEn = BP.DA.DataType.ParseStringToPinyin(this.Name); if (this.KeyOfEn.Length > 20) { this.KeyOfEn = BP.DA.DataType.ParseStringToPinyinWordFirst(this.Name); } if (this.KeyOfEn == null || this.KeyOfEn.Trim() == "") { throw new Exception("@请输入字段描述或者字段名称。"); } } catch (Exception ex) { throw new Exception("@请输入字段描述或字段名称。异常信息:" + ex.Message); } } else { this.KeyOfEn = PubClass.DealToFieldOrTableNames(this.KeyOfEn); } string keyofenC = this.KeyOfEn.Clone() as string; keyofenC = keyofenC.ToLower(); if (PubClass.KeyFields.Contains("," + keyofenC + ",") == true) { throw new Exception("@错误:[" + this.KeyOfEn + "]是字段关键字,您不能用它做字段。"); } if (this.IsExit(MapAttrAttr.KeyOfEn, this.KeyOfEn, MapAttrAttr.FK_MapData, this.FK_MapData)) { return(false); throw new Exception("@在[" + this.MyPK + "]已经存在字段名称[" + this.Name + "]字段[" + this.KeyOfEn + "]"); } this.Idx = 999; // BP.DA.DBAccess.RunSQLReturnValInt("SELECT COUNT(*) FROM Sys_MapAttr WHERE FK_MapData='" + this.FK_MapData + "'") + 1; this.MyPK = this.FK_MapData + "_" + this.KeyOfEn; return(base.beforeInsert()); }
public static void GenerRptWithXml(Entity en, string cyclostyfilename) { string temp = Web.WebUser.No + DateTime.Now.ToString("yyyyMMddhhmmss") + ".Doc"; BP.Rpt.Rtf rpt = new BP.Rpt.Rtf(); rpt.LoadCyclostyle(cyclostyfilename, temp); rpt.DataEns.AddEntity(en); rpt.MakeDocument(); string url = System.Web.HttpContext.Current.Request.ApplicationPath + "Temp/" + rpt.FileName; PubClass.OpenWordDoc(url, rpt.FileName); }
/// <summary> /// 产生一个报表 /// </summary> /// <param name="ens">要产生报表的集合</param> /// <param name="cyclostyfilename">参数文件名称。</param> public static void GenerRpt(Entities ens, string cyclostyfilename) { BP.Rpt.Doc.WebRtfReport rpt = new BP.Rpt.Doc.WebRtfReport(); rpt.LoadCyclostyle(cyclostyfilename, Web.WebUser.No + DateTime.Now.ToString("yyyyMMddhhmmss") + ".Doc"); rpt.BindEnInEns(ens); rpt.Close(); string url = System.Web.HttpContext.Current.Request.ApplicationPath + "/" + rpt.TempDir + "/" + rpt.FileName; PubClass.WinOpen(url); return; //PubClass.OpenWordDoc(url,rpt.FileName); }
/// <summary> /// 产生一个报表 /// </summary> /// <param name="ens">要产生报表的集合</param> /// <param name="cyclostyfilename">参数文件名称。</param> public static void GenerRpt(Entities ens, string cyclostyfilename) { BP.WF.WebRtfReport rpt = new BP.WF.WebRtfReport(); rpt.LoadCyclostyle(cyclostyfilename, DA.DBAccess.GenerOID() + ".doc"); rpt.BindEnInEns(ens); rpt.Close(); string url = System.Web.HttpContext.Current.Request.ApplicationPath + "/" + rpt.TempDir + "/" + rpt.FileName; PubClass.WinOpen(url); return; //PubClass.OpenWordDoc(url,rpt.FileName); }
protected string ExportDGToExcel(System.Data.DataTable dt) { string filename = WebUser.No + ".xls"; string file = filename; string filepath = SystemConfig.PathOfWebApp + "\\Temp\\"; #region 参数及变量设置 //如果导出目录没有建立,则建立. if (Directory.Exists(filepath) == false) { Directory.CreateDirectory(filepath); } filename = filepath + filename; if (System.IO.File.Exists(filename)) { System.IO.File.Delete(filename); } FileStream objFileStream = new FileStream(filename, FileMode.OpenOrCreate, FileAccess.Write); StreamWriter objStreamWriter = new StreamWriter(objFileStream, System.Text.Encoding.UTF32); #endregion string strLine = ""; //生成文件标题 foreach (DataColumn dc in dt.Columns) { strLine = strLine + dc.ColumnName + Convert.ToChar(9); } objStreamWriter.WriteLine(strLine); foreach (DataRow dr in dt.Rows) { /*生成文件内容*/ strLine = ""; foreach (DataColumn dc in dt.Columns) { string str = dr[dc.ColumnName] as string; if (str == "" || str == null) { str = " "; } strLine = strLine + str + Convert.ToChar(9); } objStreamWriter.WriteLine(strLine.Replace(Convert.ToChar(9).ToString() + Convert.ToChar(9).ToString(), Convert.ToChar(9).ToString())); } objStreamWriter.Close(); objFileStream.Close(); PubClass.WinOpen(this.Request.ApplicationPath + "/Temp/" + file); return(file); }
public override void Do() { string msg = ""; string sql = " SELECT * FROM WF_BillTemplate"; DataTable dt = DBAccess.RunSQLReturnTable(sql); foreach (DataRow dr in dt.Rows) { string file = SystemConfig.PathOfCyclostyleFile + dr["URL"].ToString() + ".rtf"; msg += RepBill.RepairBill(file); } PubClass.ResponseWriteBlueMsg(msg); }
public JsonResult Deleteids(string ids) { ViewYogaPicture model = new ViewYogaPicture(); string[] ilist = ids.TrimEnd(',').Split(','); foreach (var i in ilist) { model = client.GetById(Convert.ToInt32(i)); PubClass.FileDel(Server.MapPath(model.PictureOriginal)); client.Delete(i.ToString()); } return(Json(new { code = 0 })); }
private void BPToolBar1_ButtonClick(object sender, EventArgs e) { ToolbarBtn btn = (ToolbarBtn)sender; if (btn.ID == NamesOfBtn.Confirm) { DBLevel level = (DBLevel)this.DDL_Level.SelectedItemIntVal; string rpt = PubClass.DBRpt(level); this.Label1.Text = rpt; } else { this.Helper("DBRpt.htm"); } }
/// <summary> /// 开始迁徙 /// </summary> public void doExport() { string msg = ""; ArrayList al = new ArrayList(); foreach (ListItem li in this.CBL1.Items) { if (li.Selected == false) { continue; } Entities ens = ClassFactory.GetEns(li.Value); al.Add(ens); } PubClass.DBIO(this.CurrSelectedDBType, al, false); }
/// <summary> /// 执行 /// </summary> /// <returns>返回执行结果</returns> public override object Do() { string rpt = PubClass.DBRpt(BP.DA.DBCheckLevel.High); //// 手动升级. 2011-07-08 补充节点字段分组. //string sql = "DELETE FROM Sys_EnCfg WHERE No='BP.WF.Template.NodeSheet'"; //BP.DA.DBAccess.RunSQL(sql); //sql = "INSERT INTO Sys_EnCfg(No,GroupTitle) VALUES ('BP.WF.Template.NodeSheet','NodeID=基本配置@WarningHour=考核属性@SendLab=功能按钮标签与状态')"; //BP.DA.DBAccess.RunSQL(sql); // 修复因bug丢失的字段. MapDatas mds = new MapDatas(); mds.RetrieveAll(); foreach (MapData md in mds) { string nodeid = md.No.Replace("ND", ""); try { BP.WF.Node nd = new Node(int.Parse(nodeid)); nd.RepareMap(); continue; } catch (Exception ex) { } MapAttr attr = new MapAttr(); if (attr.IsExit(MapAttrAttr.KeyOfEn, "OID", MapAttrAttr.FK_MapData, md.No) == false) { attr.FK_MapData = md.No; attr.KeyOfEn = "OID"; attr.Name = "OID"; attr.MyDataType = BP.DA.DataType.AppInt; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = false; attr.UIIsEnable = false; attr.DefVal = "0"; attr.HisEditType = BP.En.EditType.Readonly; attr.Insert(); } } return("执行成功..."); }
//傳送答案 public void SendAnswer(int intQutionNumber) { PubClass myClass = new PubClass(); DataTable dtAnswwerImg = myClass.GetAnswerImgByID(intQutionNumber); String imgColleaction = myClass.ConvertToJsonString(dtAnswwerImg); DataTable dtUserIngfo = myClass.GetUserInfoByPhoneNumber(dtAnswwerImg.Rows[0]["phoneNumber"].ToString()); String userInfo = myClass.ConvertToJsonString(dtUserIngfo); JArray ja = new JArray(); JObject jo = new JObject(); jo.Add(new JProperty("imgCollection", imgColleaction)); jo.Add(new JProperty("userInfo", userInfo)); ja.Add(jo); String jsonString = JsonConvert.SerializeObject(ja); Clients.All.sendAnswer(jsonString); }
public ActionResult ValidLoginProcess(Models.LoginInfo li) { bool blnLogin = false; PubClass myClass = new PubClass(); blnLogin = myClass.IsLoginSuccessed(li.Acct); if (blnLogin) { DataTable dtUserInfo = myClass.dtReturn; DataRow drRowUserInfo = dtUserInfo.Rows[0]; Models.UserInfo userInfo = new Models.UserInfo(); userInfo.userName = drRowUserInfo["userName"].ToString(); userInfo.phoneNumber = drRowUserInfo["phoneNumber"].ToString(); userInfo.job = drRowUserInfo["job"].ToString(); userInfo.jobIntroduction = drRowUserInfo["jobIntroduction"].ToString(); userInfo.imgPath = drRowUserInfo["imgPath"].ToString(); //HttpCookie Cookie = new HttpCookie("LoginName", userInfo.userName); //HttpContext.Response.Cookies.Add(Cookie); Session.Add("LoginName", li.Acct); TempData["userInfo"] = userInfo; return(RedirectToAction("Chat", "Home")); //取出User電腦上是否有原有要瀏覽的網頁,因為未登入而前來登入 //HttpCookie cc = Request.Cookies["ReUrl"]; //if (cc == null) //{ // //return RedirectToAction("Main", "Member"); // return RedirectToAction("LoginSuccess"); //} //else //{ // return RedirectToAction("chat","home",new { ui = userInfo }); //} } else { return(RedirectToAction("Index", new { tp = "lf" })); } }
public void btnRefresh_Click(object sender, EventArgs e) { IUIRecord record = this.CostAccountantPart.Model.Views["UserDefAllocRate"].FocusedRecord; if (record != null) { long userRateID = PubClass.GetLong(record["ID"]); string strUserRateCode = PubClass.GetString(record["Code"]); if (!PubClass.IsNull(strUserRateCode)) { long accID = PubClass.GetLong(CostAccountantPart.CurrentState[UserDefAllocRateAccountUIFormWebPart.Const_UserDef_AccountPeriod]); string strAccCode = PubClass.GetString(CostAccountantPart.CurrentState[UserDefAllocRateAccountUIFormWebPart.Const_UserDef_AccountPeriod_Code]); string strAccName = PubClass.GetString(CostAccountantPart.CurrentState[UserDefAllocRateAccountUIFormWebPart.Const_UserDef_AccountPeriod_Name]); //GetNumAllocationDTOData getnumBP = new GetNumAllocationDTOData(); //if (userCode == "001") //{ // getnumBP.IsCarLoad = true; //} //else //{ // getnumBP.IsCarLoad = false; //} //getnumBP.AccountingPeriodID = this.CurrentModel.AccountingPeriodView.FocusedRecord.AccountingPeriod.GetValueOrDefault(); //getnumBP.UserDefAllocRateID = Convert.ToInt64(userID); //new GetNumAllocationBPProxy //{ // InDTO = getnumBP //}.Do(); GetNumAllocationBPProxy proxy = new GetNumAllocationBPProxy(); proxy.AccountPeriod = accID; proxy.UserDefAllocRateID = userRateID; proxy.UserRateCode = strUserRateCode; proxy.Do(); ((BaseAction)this.CostAccountantPart.Action).NavigateAction.Refresh(null); } } }
/// <summary> /// 产生一个报表 /// </summary> /// <param name="ens">要产生报表的集合</param> /// <param name="cyclostyfilename">参数文件名称。</param> public static string GenerRptByPeng(Entity en) { string temp = Web.WebUser.No + DateTime.Now.ToString("yyyyMMddhhmmss") + ".Doc"; BP.Rpt.Rtf rpt = new BP.Rpt.Rtf(); string BillTemplatePath = SystemConfig.GetConfigXmlEns("BillTemplatePath", en.GetNewEntities.ToString()); if (BillTemplatePath == null) { throw new Exception("生成单据出现错误:您没有在ConfigEns.xml设置他的单据模板位置。"); } rpt.LoadCyclostyle(BillTemplatePath, temp); rpt.DataEns.AddEntity(en); rpt.MakeDocument(); string url = System.Web.HttpContext.Current.Request.ApplicationPath + "Temp/" + rpt.FileName; PubClass.OpenWordDoc(url, rpt.FileName); return(url); }
/// <summary> /// 參加表報名成功 /// </summary> /// <returns></returns> public ActionResult RegistrationSuccessed(String userName) { PubClass myClass = new PubClass(); DataTable dtData = myClass.GetRegistrationData(userName); if (dtData.Rows.Count < 1) { return(RedirectToAction("Registration")); //回到報名表 } DataRow drRow = dtData.Rows[0]; Models.Registration registrationData = new Models.Registration(); registrationData.userName = drRow["userName"].ToString(); registrationData.phoneNumber = drRow["phoneNumber"].ToString(); registrationData.job = drRow["job"].ToString(); registrationData.jobIntroduction = drRow["jobIntroduction"].ToString(); registrationData.img = (byte[])drRow["img"]; return(View(registrationData)); }