Ejemplo n.º 1
0
    //增加事件
    protected void submit_Click(object sender, EventArgs e)
    {
        sqlTable st     = new sqlTable();
        int      number = 0;//填写序号

        //获取年月日以及用户名,小组
        string year     = DateTime.Now.Year.ToString();
        string month    = DateTime.Now.Month.ToString();
        string username = HttpContext.Current.Session["username"].ToString();
        string team     = HttpContext.Current.Session["team"].ToString();

        //借调判断
        if (HttpContext.Current.Session["transfer"].ToString() == "1")
        {
            string   tableNames  = "Jiediao";
            string[] result      = new string[1];
            string[] col         = { "transfer" };
            string[] translist   = { "year", "month", "username" };
            string[] transsource = { year, month, username };
            st.select_delete(tableNames, result, translist, transsource, col);
            Response.Write("<script>alert('您已被" + result[0] + ",不可填写')</script>");
            return;
        }

        //网页输入
        string New_add_engineName   = add_engineName.Text.Trim();                    //项目名称
        string New_add_onOffNum     = add_onOffNum.Text.Trim();                      //总开关量点数
        string New_add_modeNum      = add_modeNum.Text.Trim();                       //总模拟量点数
        string New_add_program      = Request.Form["add_program"].ToString().Trim(); //编程/画面
        string New_add_allDays      = add_allDays.Text.Trim();                       //总工日数
        string New_add_finishedDays = add_finishedDays.Text.Trim();                  //本月完成工日数
        string New_add_remarks      = add_remarks.Text.Trim();                       //备注

        //全为空不允许填写
        if (New_add_engineName == "" && New_add_onOffNum == "" && New_add_modeNum == "" && New_add_program == "" && New_add_allDays == "" && New_add_finishedDays == "" && New_add_remarks == "")
        {
            Response.Write("<script>alert('插入工作量为空,请重新填写')</script>");
            return;
        }

        //number在原有基础上加1
        string list1 = "number";

        string[] value     = new string[1];
        string[] tableName = { "Daily_Manage", "Debug", "Design", "LingXing", "Manage_Working", "Programing_Picture" };

        st.select_number(list1, value, tableName, year, month, username);
        if (value[0] != "" && value[0] != "NULL" && value[0] != "null")
        {
            number = int.Parse(value[0]) + 1;
        }
        else
        {
            number++;
        }
        //列名以及数据源
        string[] list   = { "year", "month", "username", "team", "number", "project_name", "digital_number", "analog_number", "programing_picture", "programing_day", "month_day", "remark" };
        string[] source = { year, month, username, team, number.ToString(), New_add_engineName, New_add_onOffNum, New_add_modeNum, New_add_program, New_add_allDays, New_add_finishedDays, New_add_remarks };

        //插入
        int res = st.table_insert("Programing_Picture", list, source);

        if (res == 1)
        {
            Response.Write("<script>alert('成功')</script>");
        }
        else if (res == 0)
        {
            Response.Write("<script>alert('输入有误,请重新输入')</script>");
        }
        else if (res == 2)
        {
            Response.Write("<script>alert('语法错误')</script>");
        }
    }
Ejemplo n.º 2
0
        //增加事件
        protected void submit_Click(object sender, EventArgs e)
        {
            sqlTable st     = new sqlTable();
            int      number = 0;//填写序号

            //获取年月日以及用户名,小组
            string year     = DateTime.Now.Year.ToString();
            string month    = DateTime.Now.Month.ToString();
            string username = HttpContext.Current.Session["username"].ToString();
            string team     = HttpContext.Current.Session["team"].ToString();

            //借调判断
            if (HttpContext.Current.Session["transfer"].ToString() == "1")
            {
                string   tableNames  = "Jiediao";
                string[] result      = new string[1];
                string[] col         = { "transfer" };
                string[] translist   = { "year", "month", "username" };
                string[] transsource = { year, month, username };
                st.select_delete(tableNames, result, translist, transsource, col);
                Response.Write("<script>alert('您已被" + result[0] + ",不可填写')</script>");
                return;
            }

            //网页输入
            string New_add_engineName  = add_engineName.Text.Trim();  //项目名称
            string New_add_quotation   = add_quotation.Text.Trim();   //商务询价报价
            string New_add_tender      = add_tender.Text.Trim();      //标书制作
            string New_add_sign        = add_sign.Text.Trim();        //合同制作与签署
            string New_add_bid         = add_bid.Text.Trim();         //投标工作
            string New_add_equip       = add_equip.Text.Trim();       //设备招标采购
            string New_add_test        = add_test.Text.Trim();        //设备出厂检测
            string New_add_dun         = add_dun.Text.Trim();         //催款(要账)
            string New_add_contract    = add_contract.Text.Trim();    //合同管理
            string New_add_others      = add_others.Text.Trim();      //其他经营活动
            string New_add_managerDays = add_managerDays.Text.Trim(); //项目经理
            string New_add_remarks     = add_remarks.Text.Trim();     //备注

            //全为空不允许填写
            if (New_add_engineName == "" && New_add_quotation == "" && New_add_tender == "" && New_add_sign == "" && New_add_bid == "" && New_add_equip == "" && New_add_test == "" && New_add_dun == "" && New_add_contract == "" && New_add_others == "" && New_add_managerDays == "" && New_add_remarks == "")
            {
                Response.Write("<script>alert('插入工作量为空,请重新填写')</script>");
                return;
            }

            //number在原有基础上加1
            string list1 = "number";

            string[] value     = new string[1];
            string[] tableName = { "Daily_Manage", "Debug", "Design", "LingXing", "Manage_Working", "Programing_Picture" };

            st.select_number(list1, value, tableName, year, month, username);
            if (value[0] != "" && value[0] != "NULL" && value[0] != "null")
            {
                number = int.Parse(value[0]) + 1;
            }
            else
            {
                number = 1;
            }
            //列名以及数据源
            string[] list   = { "year", "month", "username", "team", "number", "project_name", "xunjia_baojia", "tender", "sign", "toubiao", "equip", "test", "cuikuan", "contract", "other", "PM_day", "remark" };
            string[] source = { year, month, username, team, number.ToString(), New_add_engineName, New_add_quotation, New_add_tender, New_add_sign, New_add_bid, New_add_equip, New_add_test, New_add_dun, New_add_contract, New_add_others, New_add_managerDays, New_add_remarks };

            //插入
            int res = st.table_insert("Manage_Working", list, source);

            if (res == 1)
            {
                Response.Write("<script>alert('成功')</script>");
            }
            else if (res == 0)
            {
                Response.Write("<script>alert('输入有误,请重新输入')</script>");
            }
            else if (res == 2)
            {
                Response.Write("<script>alert('语法错误')</script>");
            }
        }
Ejemplo n.º 3
0
        //增加事件
        protected void submit_Click(object sender, EventArgs e)
        {
            sqlTable st     = new sqlTable();
            int      number = 0;//填写序号

            //获取年月日以及用户名,小组
            string year     = DateTime.Now.Year.ToString();
            string month    = DateTime.Now.Month.ToString();
            string username = HttpContext.Current.Session["username"].ToString();
            string team     = HttpContext.Current.Session["team"].ToString();

            //借调判断
            if (HttpContext.Current.Session["transfer"].ToString() == "1")
            {
                string   tableNames  = "Jiediao";
                string[] result      = new string[1];
                string[] col         = { "transfer" };
                string[] translist   = { "year", "month", "username" };
                string[] transsource = { year, month, username };
                st.select_delete(tableNames, result, translist, transsource, col);
                Response.Write("<script>alert('您已被" + result[0] + ",不可填写')</script>");
                return;
            }


            //网页输入
            string New_add_business  = add_business.Text.Trim();  //本月出差天数
            string New_add_technical = add_technical.Text.Trim(); //技术交流天数
            string New_add_others    = add_others.Text.Trim();    //其他零星工日
            string New_add_remarks   = add_remarks.Text.Trim();   //备注

            //全为空不允许填写
            if (New_add_business == "" && New_add_technical == "" && New_add_others == "" && New_add_remarks == "")
            {
                Response.Write("<script>alert('插入工作量为空,请重新填写')</script>");
                return;
            }

            //number在原有基础上加1
            string list1 = "number";

            string[] value     = new string[1];
            string[] tableName = { "Daily_Manage", "Debug", "Design", "LingXing", "Manage_Working", "Programing_Picture" };

            st.select_number(list1, value, tableName, year, month, username);
            if (value[0] != "" && value[0] != "NULL" && value[0] != "null")
            {
                number = int.Parse(value[0]) + 1;
            }
            else
            {
                number = 1;
            }
            //列名以及数据源
            string[] list   = { "year", "month", "username", "team", "number", "chuchai_day", "jiaoliu_day", "other_day", "remark" };
            string[] source = { year, month, username, team, number.ToString(), New_add_business, New_add_technical, New_add_others, New_add_remarks };

            //插入
            int res = st.table_insert("LingXing", list, source);

            if (res == 1)
            {
                Response.Write("<script>alert('成功')</script>");
            }
            else if (res == 0)
            {
                Response.Write("<script>alert('输入有误,请重新输入')</script>");
            }
            else
            {
                Response.Write("<script>alert('语法错误')</script>");
            }
        }
Ejemplo n.º 4
0
    //借调
    protected void add_Click(object sender, EventArgs e)
    {
        int    res    = 5;
        int    res2   = 5;
        string branch = "借调至";

        branch += add_index.Text.Trim();//借调部门
        string username = HttpContext.Current.Session["username"].ToString();

        //查找借调状态
        string[] onJob  = new string[1];
        string[] seList = { "transfer" };
        sqlTable st     = new sqlTable();

        st.select_login(username, onJob, "Login", seList);

        if (onJob[0] == "1")
        {
            Response.Write("<script>alert('您已被借调至其他部门')</script>");
        }
        else if (onJob[0] == "0")
        {
            string[] bra = new string[1];

            string[] list   = { "year", "month", "username" };
            string[] source = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), username };

            st.select_easy(list, source, bra, "Jiediao", seList);

            if (bra[0] == "null" || bra[0] == null || bra[0] == "NULL")
            {
                string[] list02   = { "year", "month", "username", "team", "transfer", "ratio" };
                string   t        = HttpContext.Current.Session["team"].ToString();
                string[] source02 = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), username, t, branch, "无" };
                res = st.table_insert("Jiediao", list02, source02);

                string[] soList = { "1" };
                string[] usese  = { "username", "password" };
                string[] useso  = { HttpContext.Current.Session["username"].ToString(), HttpContext.Current.Session["userpwd"].ToString() };
                res2 = st.table_update("Login", seList, soList, usese, useso);

                #region 提示
                if (res == 1 && res2 == 1)
                {
                    Response.Write("<script>alert('借调成功')</script>");
                }
                else if (res == 0 || res2 == 0)
                {
                    Response.Write("<script>alert('数组长度不一致,请联系管理员')</script>");
                }
                else if (res == 2 || res2 == 2)
                {
                    Response.Write("<script>alert('程序异常,请联系管理员')</script>");
                }
                #endregion
            }
            else
            {
                string[] sour = { branch };
                res = st.table_update("Jiediao", seList, sour, list, source);

                string[] soList = { "1" };
                string[] usese  = { "username", "password" };
                string[] useso  = { HttpContext.Current.Session["username"].ToString(), HttpContext.Current.Session["userpwd"].ToString() };
                res2 = st.table_update("Login", seList, soList, usese, useso);

                #region 提示
                if (res == 1 && res2 == 1)
                {
                    Response.Write("<script>alert('借调成功') </script>");
                }
                else if (res == 0 || res2 == 0)
                {
                    Response.Write("<script>alert('数组长度不一致,请联系管理员')</script>");
                }
                else if (res == 2 || res2 == 2)
                {
                    Response.Write("<script>alert('程序异常,请联系管理员')</script>");
                }
                #endregion
            }
        }
        else
        {
            Response.Write("<script>alert('借调状态错误,请联系管理员')</script>");
        }
        if (res == 1 && res2 == 1)
        {
            Response.Write("<script>parent.document.location.href = '../workbra.aspx' </script>");
        }
    }
Ejemplo n.º 5
0
    //增加事件
    protected void submit_Click(object sender, EventArgs e)
    {
        sqlTable st     = new sqlTable();
        int      number = 0;//填写序号
        //获取年月日以及用户名,小组
        string year     = DateTime.Now.Year.ToString();
        string month    = DateTime.Now.Month.ToString();
        string username = HttpContext.Current.Session["username"].ToString();
        string team     = HttpContext.Current.Session["team"].ToString();

        //借调判断
        if (HttpContext.Current.Session["transfer"].ToString() == "1")
        {
            string   tableNames  = "Jiediao";
            string[] result      = new string[1];
            string[] col         = { "transfer" };
            string[] translist   = { "year", "month", "username" };
            string[] transsource = { year, month, username };
            st.select_delete(tableNames, result, translist, transsource, col);
            Response.Write("<script>alert('您已被" + result[0] + ",不可填写')</script>");
            return;
        }

        //网页输入
        string New_add_index      = add_index.Text.Trim();      //添加索引
        string New_add_management = add_management.Text.Trim(); //部门内部日常管理
        string New_add_affair     = add_affair.Text.Trim();     //工会事务
        string New_add_affair2    = add_affair2.Text.Trim();    //党组事务
        string New_add_affair3    = add_affair3.Text.Trim();    //团组事务
        string New_add_examine    = add_examine.Text.Trim();    //体系内审/外审
        string New_add_check      = add_check.Text.Trim();      //考勤
        string New_add_others     = add_others.Text.Trim();     //其他报销
        string New_add_remarks    = add_remarks.Text.Trim();    //备注

        //全为空不允许填写
        if (New_add_management == "" && New_add_affair == "" && New_add_affair2 == "" && New_add_affair3 == "" && New_add_examine == "" && New_add_check == "" && New_add_others == "" && New_add_remarks == "")
        {
            Response.Write("<script>alert('插入工作量为空,请重新填写')</script>");
            return;
        }

        //当月日常工作总工日汇总
        float monthSum = 0;

        if (add_management.Text != "")
        {
            monthSum += float.Parse(New_add_management);
        }
        if (add_affair.Text != "")
        {
            monthSum += float.Parse(New_add_affair);
        }
        if (add_affair2.Text != "")
        {
            monthSum += float.Parse(New_add_affair2);
        }
        if (add_affair3.Text != "")
        {
            monthSum += float.Parse(New_add_affair3);
        }
        if (add_examine.Text != "")
        {
            monthSum += float.Parse(New_add_examine);
        }
        if (add_check.Text != "")
        {
            monthSum += float.Parse(New_add_check);
        }
        if (add_others.Text != "")
        {
            monthSum += float.Parse(New_add_others);
        }

        //number在原有基础上加1
        string list1 = "number";

        string[] value     = new string[1];
        string[] tableName = { "Daily_Manage", "Debug", "Design", "LingXing", "Manage_Working", "Programing_Picture" };

        st.select_number(list1, value, tableName, year, month, username);
        if (value[0] != "" && value[0] != "NULL" && value[0] != "null")
        {
            number = int.Parse(value[0]) + 1;
        }
        else
        {
            number = 1;
        }
        //列名以及数据源
        string[] list   = { "year", "month", "username", "team", "number", "management", "affair_gonghui", "affair_dangzu", "affair_tuanzu", "examine", "kaoqin", "other", "month_day", "remark" };
        string[] source = { year, month, username, team, number.ToString(), New_add_management, New_add_affair, New_add_affair2, New_add_affair3, New_add_examine, New_add_check, New_add_others, monthSum.ToString(), New_add_remarks };

        //插入
        int res = st.table_insert("Daily_Manage", list, source);

        if (res == 1)
        {
            Response.Write("<script>alert('成功')</script>");
        }
        else if (res == 0)
        {
            Response.Write("<script>alert('程序异常')</script>");
        }
        else if (res == 2)
        {
            Response.Write("<script>alert('语法错误')</script>");
        }
    }
Ejemplo n.º 6
0
        protected void submit_Click(object sender, EventArgs e)
        {
            String NewUserName = add_username.Text.ToString().Trim();      //用户名
            String NewUserPass = add_userpass.Text.ToString().Trim();      //密码
            String RealName    = add_realname.Text.ToString().Trim();      //真实姓名
            String Job         = Request.Form["job"].ToString().Trim();    //power
            String Master      = Request.Form["master"].ToString().Trim(); //副主任
            string peonumber   = PeopleNumber.Text.ToString().Trim();      //员工编号
            int    power       = 0;

            switch (Job)
            {
            case "职员":
                power = 18;
                break;

            case "2":
                switch (Master)
                {
                case "项目管理副主任":
                    power = 2;
                    break;

                case "设计管理副主任":
                    power = 3;
                    break;

                case "编程管理副主任":
                    power = 4;
                    break;

                case "软件管理副主任":
                    power = 5;
                    break;

                case "仪表管理副主任":
                    power = 6;
                    break;
                }
                break;

            default:
                power = 1;
                break;
            }
            String Group = Request.Form["group"].ToString().Trim();//小组

            if (Group == "自动化")
            {
                Group = "1";
            }
            else if (Group == "软件")

            {
                Group = "2";
            }
            else if (Group == "营销")
            {
                Group = "3";
            }
            else if (Group == "管理层")
            {
                Group = "0";
            }
            //列名以及数据源
            string[] list   = { "power", "username", "password", "name", "team", "transfer", "peoplenumber", "on_job" };
            string[] source = { power.ToString(), NewUserName, NewUserPass, RealName, Group, "0", peonumber, "1" };

            //插入
            if (NewUserName == "" || NewUserPass == "" || RealName == "")
            {
                Response.Write("<script>alert('请输入完整信息')</script>");
            }
            else
            {
                sqlTable st  = new sqlTable();
                int      res = st.table_insert("Login", list, source);
                if (res == 1)
                {
                    Response.Write("<script>alert('成功')</script>");
                }
                else
                {
                    Response.Write("<script>alert('输入有误,请重新输入')</script>");
                }
            }
        }