Esempio n. 1
0
        /// <summary>
        /// 插入一条派工单BUG
        /// </summary>
        /// <param name="ProjectGuidID"></param>
        /// <param name="Stitle"></param>
        /// <param name="Content"></param>
        /// <param name="Kind"></param>
        /// <param name="f1"></param>
        /// <returns></returns>
        public int NewBug(String ProjectGuidID,
                          int BugA, int BugB, int BugC, int Kind,
                          String Remark, System.Web.UI.WebControls.FileUpload f1)
        {
            int    succ      = 0;
            String FileDir   = "/Attachment/UseAttachment/";
            String truename1 = String.Empty;
            bool   saveFile  = false;

            try
            {
                Dictionary <String, object> dic1 = new Dictionary <string, object>();

                dic1["guidID"]     = WebFrame.Util.JString.GetUnique32ID();
                dic1["parentGuid"] = ProjectGuidID;

                dic1["BugA"] = BugA;
                dic1["BugB"] = BugB;
                dic1["BugC"] = BugC;

                dic1["Remark"] = Remark;
                dic1["Kind"]   = Kind;

                dic1["AddTime"]    = DateTime.Now;
                dic1["AddUserID"]  = WebFrame.FrameLib.UserID;
                dic1["AddUserNet"] = WebFrame.FrameLib.UserName;

                if (f1 != null && f1.HasFile)
                {
                    String ext1 = Path.GetExtension(f1.FileName);
                    truename1 = WebFrame.Util.JString.GetUnique32ID() + ext1;
                    f1.SaveAs(System.Web.HttpContext.Current.Server.MapPath(FileDir + truename1));
                    dic1["RelateFile"]   = FileDir + truename1;
                    dic1["RelaTrueName"] = Path.GetFileName(f1.FileName);

                    saveFile = true;
                }

                Tb_Task_BugDA da1 = new Tb_Task_BugDA();
                da1.NewData(dic1);
                succ = 1;
            }
            catch (Exception err)
            {
                //删除已上传的文件
                //删除已上传的文件
                if (saveFile && File.Exists(System.Web.HttpContext.Current.Server.MapPath(FileDir + truename1)))
                {
                    File.Delete(System.Web.HttpContext.Current.Server.MapPath(FileDir + truename1));
                }
                throw err;
            }

            return(succ);
        }
Esempio n. 2
0
 /// <summary>
 /// 新增一条数据
 /// </summary>
 /// <param name="data1">Dictionary数据</param>
 public void NewData(Dictionary <String, object> data1)
 {
     try
     {
         Tb_Task_BugDA da1 = new Tb_Task_BugDA();
         da1.NewData(data1);
         this.executeResultCount = da1.ExecuteResultCount;
     }
     catch (Exception err)
     {
         this.ErrorInfo = err.Message.Replace("\r", "").Replace("\t", "").Replace("\n", "");
     }
 }
Esempio n. 3
0
        /// <summary>
        /// 插入一条派工单BUG
        /// </summary>
        /// <param name="ProjectGuidID"></param>
        /// <param name="Stitle"></param>
        /// <param name="Content"></param>
        /// <param name="Kind"></param>
        /// <param name="f1"></param>
        /// <returns></returns>
        public int NewBug(String ProjectGuidID,
                          int BugA, int BugB, int BugC, int Kind,
                          String Remark, String RelateFile,
                          String RelaTrueName)
        {
            int succ = 0;

            try
            {
                Dictionary <String, object> dic1 = new Dictionary <string, object>();

                dic1["guidID"]     = WebFrame.Util.JString.GetUnique32ID();
                dic1["parentGuid"] = ProjectGuidID;

                dic1["BugA"] = BugA;
                dic1["BugB"] = BugB;
                dic1["BugC"] = BugC;

                dic1["Remark"] = Remark;
                dic1["Kind"]   = Kind;

                dic1["AddTime"]    = DateTime.Now;
                dic1["AddUserID"]  = WebFrame.FrameLib.UserID;
                dic1["AddUserNet"] = WebFrame.FrameLib.UserName;

                dic1["RelateFile"]   = RelateFile;
                dic1["RelaTrueName"] = RelaTrueName;

                Tb_Task_BugDA da1 = new Tb_Task_BugDA();
                da1.NewData(dic1);
                succ = 1;
            }
            catch (Exception err)
            {
                //删除已上传的文件
                throw err;
            }

            return(succ);
        }