//提交数据的代码
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            String  error = String.Empty;
            Control con1  = bean1.CheckControls(out error); //进行数据验证

            if (con1 != null)
            {
                UTools.Alert(error);
            }
            else
            {
                JUserBU bu1       = new JUserBU();
                String  olduserid = String.Empty;
                if (this.UserID.Enabled == false)
                {
                    olduserid = this.UserID.Text;
                }
                int succ = bu1.SaveData(olduserid, this.Num.Text, this.UserID.Text, this.UserName.Text,
                                        this.Status.SelectedValue, this.AuthorityID.SelectedValue, "");
                if (succ == 1)   //submit succ
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";
                    js1 = js1 + " parent.$('#butSearch').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    UTools.Alert("操作失败,请重试!");
                }
            }
        }
Beispiel #2
0
        //提示和聚焦控件
        public static void AlertAndFocusControl(String info, String ClientID)
        {
            String js1 = "layer.alert('{0}');";

            js1 = js1 + "$('#{1}').focus();";
            JAjax.ExecuteJS(String.Format(js1, info, ClientID));
        }
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            if (this.file1.CheckData())
            {
                KORWeb.BUL.Tb_TaskBU bu1 = new KORWeb.BUL.Tb_TaskBU();
                String f1 = Server.MapPath("/Attachment/Temp/taskdata.xls");
                this.file1.SaveAs(f1);
                bool succ = bu1.ExportDataFromXls(this.parentGuid.Text, f1, "1");
                if (succ)
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";

                    js1 = js1 + " parent.$('#butSearch').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    WebFrame.Util.JAjax.Alert("错误:操作失败,请重试!");
                }
            }
            else
            {
                WebFrame.Util.JAjax.Alert("错误:请选择一个正确的工单Excel文件上传!");
            }
        }
        //Submit data
        void button2_ServerClick(object sender, EventArgs e)
        {
            String itemName = Request.QueryString["Itemname"];

            if (String.IsNullOrEmpty(itemName) == false)
            {
                String errorInfo = bill1.CheckData();
                if (String.IsNullOrEmpty(errorInfo) == false)
                {
                    //JAjax.Alert(errorInfo);
                    UTools.Alert(errorInfo);
                }
                else
                {
                    JItemDetailBU bu2       = new JItemDetailBU();
                    DataTable     data      = bill1.GetData();
                    String        errorinfo = bu2.SaveItemData(itemName, data);
                    if (String.IsNullOrEmpty(errorinfo) == false)
                    {
                        //JAjax.Alert(errorinfo);
                        UTools.Alert(errorinfo);
                    }
                    else
                    {
                        String js1 = "layer.alert('操作成功!',function(index){;";
                        js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";
                        js1 = js1 + " parent.$('#butSearch').click();";
                        js1 = js1 + " parent.layer.close(index);});";
                        JAjax.ExecuteJS(js1);
                    }
                }
            }
        }
        //提交数据的代码
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            String error = String.Empty;

            //设置父编码的值

            Control con1 = bean1.CheckControls(out error);  //后台进行数据验证

            if (con1 != null)
            {
                UTools.Alert(error);
            }
            else
            {
                Dictionary <String, object> dic1 = bean1.GetControlValues();
                dic1["AuthorityGroup"] = WebFrame.FrameLib.AuthorityGroup;
                dic1["[PassWord]"]     = "123456";
                dic1["LoginCount"]     = 0;

                int succ = bean1.SaveDataToDb(dic1);
                if (succ == 1)   //submit succ
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";
                    js1 = js1 + " parent.$('#butSearch').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    UTools.Alert("操作失败,请重试!");
                }
            }
        }
        //提交数据的代码
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            String error = String.Empty;

            //设置父编码的值

            Control con1 = bean1.CheckControls(out error);  //后台进行数据验证

            if (con1 != null)
            {
                UTools.Alert(error);
            }
            else
            {
                Dictionary <String, object> dic1 = bean1.GetControlValues();
                int succ = bean1.SaveDataToDb(dic1);

                if (succ == 1)     //submit succ
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";
                    js1 = js1 + " parent.$('#butSearch').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    //Response.Write(bean1.MyException.ToString());
                    UTools.Alert("操作失败,请重试!");
                }
            }
        }
        //提交数据
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            String taskid = Request.QueryString["TaskID"];

            if (String.IsNullOrEmpty(taskid) == false &&
                WebFrame.Util.JValidator.IsDateTime(this.PlanDate.Text))
            {
                String    doman  = this.ExecuteManID.SelectedValue;
                string    doman1 = this.ExecuteManID.SelectedItem.Text;
                Tb_TaskBU bu1    = new Tb_TaskBU();
                bool      succ1  = bu1.JieDanTask(taskid, doman, doman1, this.PlanDate.Text);

                if (succ1)   //submit succ
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";

                    js1 = js1 + " parent.$('#butSearch').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    UTools.Alert("操作失败,请重试!");
                }
            }
            else
            {
                UTools.Alert("操作失败,可能的原因是数据类型错误!");
            }
        }
        //提交数据的代码
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            String error = String.Empty;

            Control con1 = bean1.CheckControls(out error);  //后台进行数据验证

            if (con1 != null)
            {
                UTools.Alert(error);
            }
            else
            {
                int succ = bean1.SaveDataToDb();
                if (succ == 1)   //submit succ
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";

                    js1 = js1 + " parent.$('#ctl00_ContentPlaceHolder1_butSearch2').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    //throw bean1.MyException;
                    UTools.Alert("操作失败,请重试!");
                }
            }
        }
Beispiel #9
0
        //提交数据的代码
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            String error = String.Empty;

            Control con1 = bean1.CheckControls(out error);  //后台进行数据验证

            if (con1 != null)
            {
                UTools.Alert(error);
            }
            else
            {
                Dictionary <string, object> dic1 = this.bean1.GetControlValues();
                dic1["AddTime"]     = DateTime.Now;
                dic1["AddUserID"]   = WebFrame.FrameLib.UserID;
                dic1["AddUserName"] = WebFrame.FrameLib.UserName;

                int succ = bean1.SaveDataToDb(dic1);
                if (succ == 1)   //submit succ
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";

                    js1 = js1 + " parent.$('#ctl00_ContentPlaceHolder1_butSearch2').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    //throw bean1.MyException;
                    UTools.Alert("操作失败,请重试!");
                }
            }
        }
Beispiel #10
0
        //提交数据的代码
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            String error = String.Empty;

            //设置父编码的值
            this.Parent.Text = this.Parent1.SelectedValue;

            Control con1 = bean1.CheckControls(out error);  //后台进行数据验证

            if (con1 != null)
            {
                UTools.Alert(error);
            }
            else
            {
                int succ = bean1.SaveDataToDb();
                if (succ == 1)   //submit succ
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";
                    js1 = js1 + " parent.$('#butSearch').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    UTools.Alert("操作失败,请重试!");
                }
            }
        }
        //附件列表刷新
        void butRefresh1_Click(object sender, EventArgs e)
        {
            //this.data3.DataBind();
            this.Repeater2.DataBind();
            String js1 = "AttachmentRefresh();";

            JAjax.ExecuteJS(js1);
        }
Beispiel #12
0
        //提交工单信息
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            int succ = 0;

            WebFrame.Data.JConnect.GetConnect().BeginTrans();
            try
            {
                String guidid = Request.QueryString["GuidID"];
                Dictionary <string, object> dic1 = new Dictionary <string, object>();

                Tb_TaskBU bu1 = new Tb_TaskBU();

                //1--更新数据
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("Guidid", guidid));
                String t1 = String.Empty;
                if (this.CheckResult.SelectedValue == "1")
                {
                    dic1["LastWorkLoad"] = this.LastWorkload.Text;
                    dic1["Status"]       = "4";
                    t1 = "工单通过审核";
                }
                else
                {
                    dic1["Status"] = "1";
                    t1             = "工单未通过审核";
                }

                bu1.EditData(condition, dic1);

                //2--创建日志
                Tb_Task_LogBU bu2 = new Tb_Task_LogBU();
                succ = bu2.NewLog(guidid, t1, this.Remark.Text, "0", this.file1);
                WebFrame.Data.JConnect.GetConnect().CommitTrans();
            }
            catch (Exception err)
            {
                WebFrame.Data.JConnect.GetConnect().RollBackTrans();
                succ = 0;
                WebFrame.Util.JTool.WriteErrorLog(err.ToString());
            }

            if (succ == 1)   //submit succ
            {
                String js1 = "layer.alert('操作成功!',function(index){;";
                js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";

                js1 = js1 + " parent.$('#butSearch').click();";
                js1 = js1 + " parent.layer.close(index);});";
                JAjax.ExecuteJS(js1);
            }
            else
            {
                //throw bean1.MyException;
                UTools.Alert("操作失败,请重试!");
            }
        }
        //提交附件处理
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            if (this.file1.HasFile)
            {
                bool succ = false;
                try
                {
                    Dictionary <String, object> dic1 = new Dictionary <string, object>();
                    dic1["guidID"]       = this.guidID.Text;
                    dic1["parentGuid"]   = this.parentGuid.Text;
                    dic1["FileName"]     = Path.GetFileName(this.file1.FileName);
                    dic1["UploadTime"]   = DateTime.Now;
                    dic1["UploadPerson"] = WebFrame.FrameLib.UserID;
                    dic1["Describle"]    = "项目进度安排的附件";
                    dic1["del"]          = 0;
                    dic1["FileDir"]      = "/Attachment/UseAttachment/";

                    String ext1      = Path.GetExtension(this.file1.FileName);
                    String truename1 = WebFrame.Util.JString.GetUnique32ID() + ext1;
                    this.file1.SaveAs(Server.MapPath(dic1["FileDir"].ToString() + truename1));

                    dic1["EncryptFileName"] = dic1["FileDir"] + truename1;
                    this.bean1.SaveDataToDb(dic1);
                    succ = true;
                }
                catch (Exception err)
                {
                    WebFrame.Util.JTool.WriteErrorLog(err.ToString());
                }


                if (succ)   //submit succ
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";

                    js1 = js1 + " parent.$('#ctl00_ContentPlaceHolder1_butSearch2').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    UTools.Alert("操作失败,请重试!");
                }
            }
            else
            {
                UTools.Alert("提示:请选择一个要上传的附件!");
            }
        }
Beispiel #14
0
        //提交工单信息
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            int bugA = 0;
            int bugB = 0;
            int bugC = 0;

            int.TryParse(this.BugA.Text, out bugA);
            int.TryParse(this.BugB.Text, out bugB);
            int.TryParse(this.BugC.Text, out bugC);

            int succ1 = 0;

            if (bugA < 0 || bugB < 0 || bugC < 0 || (bugA + bugB + bugC) <= 0)
            {
                UTools.Alert("提示:请至少输入一个BUG数量!");
            }
            else
            {
                try
                {
                    String guidid = Request.QueryString["GuidID"];
                    Dictionary <string, object> dic1 = new Dictionary <string, object>();

                    Tb_Task_BugBU bu3 = new Tb_Task_BugBU();
                    succ1 = bu3.NewBug(guidid, bugA, bugB, bugC, 1, this.Remark.Text, this.file1);
                }
                catch (Exception err)
                {
                    succ1 = 0;
                    WebFrame.Util.JTool.WriteErrorLog(err.ToString());
                }

                if (succ1 == 1)   //submit succ
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";

                    js1 = js1 + " parent.$('#butSearch').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    //throw bean1.MyException;
                    UTools.Alert("操作失败,请重试!");
                }
            }
        }
        //确定返回
        void buttonSearch_Click(object sender, EventArgs e)
        {
            String selLine = String.Empty;

            foreach (RepeaterItem item in this.repeater1.Items)
            {
                String t1 = String.Empty;
                String a1 = (item.FindControl("astation") as TextBox).Text.Trim();
                String b1 = (item.FindControl("bstation") as TextBox).Text.Trim();
                String c1 = (item.FindControl("sd") as DropDownList).SelectedValue.Trim();

                if (a1 != String.Empty && b1 != String.Empty)
                {
                    String id1 = (item.FindControl("lineid") as TextBox).Text.Trim();
                    if (id1 != String.Empty)
                    {
                        t1 = a1 + "-" + b1 + "(" + id1 + "#" + c1 + ")";
                    }
                    else
                    {
                        t1 = a1 + "-" + b1 + "(" + "0" + "#" + c1 + ")";
                    }
                    if (selLine == String.Empty)
                    {
                        selLine = t1;
                    }
                    else
                    {
                        selLine = selLine + "," + t1;
                    }
                }
            }

            if (selLine != String.Empty)
            {
                String js = "";
                js = js + "var parentid = '" + Request.QueryString["parent"] + "';";
                js = js + " if (parentid != '' && window.opener != null) { ";
                js = js + " window.opener.document.getElementById(parentid).value = '" + selLine + "'; ";
                js = js + " window.close(); }";
                JAjax.ExecuteJS(js);
            }
            else
            {
                JAjax.Alert("错误:没有选择合适的分段!");
            }
        }
        //提交数据的代码
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            String error = String.Empty;

            Control con1 = bean1.CheckControls(out error);  //后台进行数据验证

            if (con1 != null)
            {
                UTools.Alert(error);
            }
            else
            {
                Dictionary <String, object> dic1 = bean1.GetControlValues();
                dic1["ManagerID"]   = WebFrame.FrameLib.UserID;
                dic1["ManagerName"] = WebFrame.FrameLib.UserName;
                if (String.IsNullOrEmpty(dic1["PlanDate"].ToString()))
                {
                    dic1["PlanDate"] = DateTime.Parse(dic1["AddTime"].ToString()).AddDays(3).ToString("yyyy-MM-dd");
                }
                dic1["Status"] = "0";

                int succ = bean1.SaveDataToDb(dic1);

                //插入工单日志
                Tb_Task_LogBU bu2 = new Tb_Task_LogBU();
                bu2.NewLog(this.GuidID.Text, "创建工单", "");

                if (succ == 1)   //submit succ
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";

                    js1 = js1 + " parent.$('#butSearch').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    //throw bean1.MyException;
                    UTools.Alert("操作失败,请重试!");
                }
            }
        }
        void but1_Click(object sender, EventArgs e)
        {
            String userid = this.seluserid.Value;
            String roleid = Request["RoleID"];

            if (String.IsNullOrEmpty(userid) == false &&
                String.IsNullOrEmpty(roleid) == false)
            {
                WebFrame.Comm.JRoleUsersBU bu1 = new WebFrame.Comm.JRoleUsersBU();
                bu1.SetRoleUserID(roleid, userid, "0");
            }

            String js1 = "layer.alert('操作成功!',function(index){;";

            js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";
            js1 = js1 + " parent.$('#butSearch').click();";
            js1 = js1 + " parent.layer.close(index);});";
            JAjax.ExecuteJS(js1);
        }
Beispiel #18
0
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            String error = String.Empty;

            Control con1 = bean1.CheckControls(out error);  //后台进行数据验证

            if (con1 != null)
            {
                UTools.Alert(error);
            }
            else
            {
                this.UserName.Text = this.UserID.SelectedItem.Text;


                Dictionary <String, object> dic1 = bean1.GetControlValues();
                //KORWeb.DAL.Tb_KH_ProjectDA da1 = new KORWeb.DAL.Tb_KH_ProjectDA();
                //da1.TableName = "Tb_Project_Money";
                //dic1.Remove("DataID");
                //da1.NewData(dic1);

                int succ = bean1.SaveDataToDb(dic1);
                //int succ = 1;
                if (succ == 1)   //submit succ
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";

                    js1 = js1 + " parent.$('#ctl00_ContentPlaceHolder1_butSearchProject').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    //throw bean1.MyException;
                    UTools.Alert("操作失败,请重试!");
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                String    guidid = Request.QueryString["GuidID"];
                Tb_TaskBU bu1    = new Tb_TaskBU();
                DataRow   dr1    = bu1.GetFirstDataRow(guidid, "TaskKind");
                int       succ   = 0;
                if (dr1 != null)
                {
                    String taskkind = dr1[0].ToString();
                    if (taskkind == "1")  //处理非开发工单
                    {
                        WebFrame.Data.JConnect.GetConnect().BeginTrans();

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

                            //1--更新数据
                            List <SearchField> condition = new List <SearchField>();
                            condition.Add(new SearchField("Guidid", guidid));
                            String result = String.Empty;
                            dic1["Status"]     = "3";
                            dic1["finishDate"] = DateTime.Now;
                            result             = "提交审核";


                            bu1.EditData(condition, dic1);

                            //2--创建日志
                            String relatefile   = String.Empty;
                            String relatruename = String.Empty;

                            Tb_Task_LogBU bu2 = new Tb_Task_LogBU();
                            succ = bu2.NewLog(guidid, result, this.Remark.Text, "2", this.file1,
                                              ref relatefile, ref relatruename);

                            WebFrame.Data.JConnect.GetConnect().CommitTrans();
                        }
                        catch (Exception err)
                        {
                            WebFrame.Data.JConnect.GetConnect().RollBackTrans();
                        }

                        if (succ == 1)   //submit succ
                        {
                            String js1 = "layer.alert('操作成功!',function(index){;";
                            js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";

                            js1 = js1 + " parent.$('#butSearch').click();";
                            js1 = js1 + " parent.layer.close(index);});";
                            JAjax.ExecuteJS(js1);
                        }
                        else
                        {
                            //throw bean1.MyException;
                            UTools.Alert("操作失败,请重试!");
                        }
                    }
                }
            }
        }
Beispiel #20
0
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            String  error = String.Empty;
            Control con1  = bean1.CheckControls(out error); //后台进行数据验证

            if (con1 != null)
            {
                UTools.Alert(error);
            }
            else
            {
                int    succ      = 0;
                int    succ1     = 0;
                bool   saveFile  = false;
                String FileDir   = "/Attachment/UseAttachment/";
                String truename1 = String.Empty;
                WebFrame.Data.JConnect.GetConnect().BeginTrans();
                try
                {
                    Dictionary <String, object> dic1 = bean1.GetControlValues();
                    dic1["Workload"] = double.Parse(this.Workload.Text);

                    dic1["content"]     = (new StringBuilder()).Append(this.content.Text);
                    dic1["contentText"] = (new StringBuilder()).Append(WebFrame.Util.JString.NoHTML(this.content.Text));

                    if (this.file1.HasFile)
                    {
                        String ext1 = Path.GetExtension(this.file1.FileName);
                        truename1 = WebFrame.Util.JString.GetUnique32ID() + ext1;
                        this.file1.SaveAs(Server.MapPath(FileDir + truename1));
                        dic1["RelaFile"]     = FileDir + truename1;
                        dic1["RelaTrueName"] = Path.GetFileName(this.file1.FileName);
                        saveFile             = true;

                        //如果以前有附件,则删除
                        String s1 = this.data1.Eval("RelaFile");
                        if (String.IsNullOrEmpty(s1) == false)
                        {
                            s1 = Server.MapPath(s1);
                            if (File.Exists(s1))
                            {
                                File.Delete(s1);
                            }
                        }
                    }

                    if (String.IsNullOrEmpty(dic1["ExecuteMan"].ToString()))
                    {
                        dic1["Status"] = "0";
                        succ1          = 1;
                    }
                    else
                    {
                        dic1["Status"] = "1";
                        //创建日志
                    }
                    //dic1["Manager"] = WebFrame.FrameLib.UserID;
                    //dic1["AddTime"] = DateTime.Now;
                    //dic1["AddUser"] = WebFrame.FrameLib.UserID;

                    succ = bean1.SaveDataToDb(dic1);

                    //如操作成功,则插入派工单的日志
                    if (succ == 1 && dic1["Status"].ToString() == "1")
                    {
                        succ1 = (new Tb_Task_LogBU()).NewLog(this.GuidID.Text, "将工单分配给" + dic1["ExecuteMan"].ToString(), "", "0", null);
                    }

                    WebFrame.Data.JConnect.GetConnect().CommitTrans();
                }
                catch (Exception err)
                {
                    WebFrame.Data.JConnect.GetConnect().RollBackTrans();
                    succ = 0;
                }

                //操作成功
                if (succ == 1)    //submit succ
                {
                    String js1 = "layer.msg('操作成功!',{ icon: 1, time: 2000 },function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";
                    js1 = js1 + " parent.$('#butSearch').click();";
                    js1 = js1 + " parent.layer.close(index);";
                    //js1 = js1 + String.Format(" location.href='TB_Task_Detail_ADD.aspx?ProjectGuidID={0}';", this.ProjectGuidID.SelectedValue);
                    js1 = js1 + " });";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    if (saveFile && File.Exists(Server.MapPath(FileDir + truename1)))
                    {
                        File.Delete(Server.MapPath(FileDir + truename1));
                    }
                    UTools.Alert("操作失败,请重试!");
                }
            }
        }
Beispiel #21
0
        //提交工单信息
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            int succ  = 0;
            int succ1 = 0;

            int  bugA      = 0;
            int  bugB      = 0;
            int  bugC      = 0;
            bool checkdata = true;

            //表示测试未通过,验证数据的合理性
            if (this.TestResult.SelectedValue == "0")
            {
                int.TryParse(this.BugA.Text, out bugA);
                int.TryParse(this.BugB.Text, out bugB);
                int.TryParse(this.BugC.Text, out bugC);

                if (bugA < 0 || bugB < 0 || bugC < 0 || (bugA + bugB + bugC) <= 0)
                {
                    checkdata = false;
                    UTools.Alert("提示:测试未通过,请至少输入一个BUG数量!");
                }
            }

            if (checkdata)
            {
                WebFrame.Data.JConnect.GetConnect().BeginTrans();
                try
                {
                    String guidid = Request.QueryString["GuidID"];
                    Dictionary <string, object> dic1 = new Dictionary <string, object>();

                    Tb_TaskBU bu1 = new Tb_TaskBU();

                    //1--更新数据
                    List <SearchField> condition = new List <SearchField>();
                    condition.Add(new SearchField("Guidid", guidid));
                    String result = String.Empty;
                    if (this.TestResult.SelectedValue == "1")
                    {
                        dic1["Status"] = "3";
                        result         = "测试通过";
                        succ1          = 1;
                    }
                    else
                    {
                        dic1["Status"] = "1";
                        result         = "测试未通过";
                    }

                    bu1.EditData(condition, dic1);

                    //2--创建日志
                    String relatefile   = String.Empty;
                    String relatruename = String.Empty;

                    Tb_Task_LogBU bu2 = new Tb_Task_LogBU();
                    succ = bu2.NewLog(guidid, result, this.Remark.Text, "1", this.file1,
                                      ref relatefile, ref relatruename);


                    //3--登记Bug记录
                    if (this.TestResult.SelectedValue == "0")
                    {
                        Tb_Task_BugBU bu3 = new Tb_Task_BugBU();
                        succ1 = bu3.NewBug(guidid, bugA, bugB, bugC, 0, this.Remark.Text, relatefile, relatruename);
                    }

                    WebFrame.Data.JConnect.GetConnect().CommitTrans();
                }
                catch (Exception err)
                {
                    WebFrame.Data.JConnect.GetConnect().RollBackTrans();
                    succ  = 0;
                    succ1 = 0;
                    WebFrame.Util.JTool.WriteErrorLog(err.ToString());
                }

                if (succ == 1 && succ1 == 1)   //submit succ
                {
                    String js1 = "layer.alert('操作成功!',function(index){;";
                    js1 = js1 + " var index = parent.layer.getFrameIndex(window.name);";

                    js1 = js1 + " parent.$('#butSearch').click();";
                    js1 = js1 + " parent.layer.close(index);});";
                    JAjax.ExecuteJS(js1);
                }
                else
                {
                    //throw bean1.MyException;
                    UTools.Alert("操作失败,请重试!");
                }
            }
        }
Beispiel #22
0
        //提示
        public static void Alert(String info)
        {
            String js1 = "layer.alert('{0}');";

            JAjax.ExecuteJS(String.Format(js1, info));
        }