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_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.º 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_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.º 4
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>");
        }
    }