예제 #1
0
        //修改内容拉取
        protected void add_Click(object sender, EventArgs e)
        {
            sqlTable st = new sqlTable();

            //网页输入
            string New_add_index = add_index.Text.Trim(); // 索引

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

            //查找索引是否存在
            string[] listNumber      = { "year", "month", "username", "number" };
            string[] sourceNumber    = { year, month, username, New_add_index };
            string[] selectNumber    = { "number" };
            string   tableNameNumber = "Manage_Working";

            string[] resNumber = new string[1];
            st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
            if (New_add_index != resNumber[0])
            {
                Response.Write("<script>alert('填写序号有误')</script>");
                return;
            }

            //查找原来日常工作量当月汇总
            string[] list        = { "year", "month", "username", "number" };
            string[] source      = { year, month, username, New_add_index };
            string[] select_List = { "project_name", "xunjia_baojia", "tender", "sign", "toubiao", "equip", "test", "cuikuan", "contract", "other", "PM_day", "remark" };
            string[] data        = new string[12];
            st.select_delete("Manage_Working", data, list, source, select_List);

            //text框赋值
            add_engineName.Text  = data[0];  //项目名称
            add_quotation.Text   = data[1];  //商务询价报价
            add_tender.Text      = data[2];  //标书制作
            add_sign.Text        = data[3];  //合同制作与签署
            add_bid.Text         = data[4];  //投标工作
            add_equip.Text       = data[5];  //设备招标采购
            add_test.Text        = data[6];  //设备出厂检测
            add_dun.Text         = data[7];  //催款(要账)
            add_contract.Text    = data[8];  //合同管理
            add_others.Text      = data[9];  //其他经营活动
            add_managerDays.Text = data[10]; //项目经理
            add_remarks.Text     = data[11]; //备注
        }
예제 #2
0
        //修改内容拉取
        protected void add_Click(object sender, EventArgs e)
        {
            sqlTable st = new sqlTable();

            //网页输入
            string New_add_index = add_index.Text.Trim(); // 索引

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

            //查找索引是否存在
            string[] listNumber      = { "year", "month", "username", "number" };
            string[] sourceNumber    = { year, month, username, New_add_index };
            string[] selectNumber    = { "number" };
            string   tableNameNumber = "Design";

            string[] resNumber = new string[1];
            st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
            if (New_add_index != resNumber[0])
            {
                Response.Write("<script>alert('填写序号有误')</script>");
                return;
            }

            //查找原来日常工作量当月汇总
            string[] list        = { "year", "month", "username", "number" };
            string[] source      = { year, month, username, New_add_index };
            string[] select_List = { "project_number", "project_name", "drawing_number", "A1_number", "zhehe_working_day", "month_day", "program_day", "basic_design_day", "leader", "remark" };
            string[] data        = new string[10];
            st.select_delete("Design", data, list, source, select_List);

            //text框赋值
            add_engine.Text       = data[0]; //工程号
            add_engineName.Text   = data[1]; //工程名称
            add_paperPage.Text    = data[2]; //图纸张数
            add_al.Text           = data[3]; //折合A1
            add_allDays.Text      = data[4]; //折合总工日数
            add_finishedDays.Text = data[5]; //本月完成工日数
            add_usedDays.Text     = data[6]; //技术方案工作量所用工日数
            add_usedDays2.Text    = data[7]; //基本设计工作量所用工日数
            add_leaderDays.Text   = data[8]; //工日
            add_remarks.Text      = data[9]; //备注
        }
예제 #3
0
    //修改内容拉取
    protected void add_Click(object sender, EventArgs e)
    {
        sqlTable st = new sqlTable();

        //网页输入
        string New_add_index = add_index.Text.Trim(); // 索引

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

        //查找索引是否存在
        string[] listNumber      = { "year", "month", "username", "number" };
        string[] sourceNumber    = { year, month, username, New_add_index };
        string[] selectNumber    = { "number" };
        string   tableNameNumber = "Daily_Manage";

        string[] resNumber = new string[1];
        st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
        if (New_add_index != resNumber[0])
        {
            Response.Write("<script>alert('填写序号有误')</script>");
            return;
        }

        //查找原来日常工作量当月汇总
        string[] list        = { "year", "month", "username", "number" };
        string[] source      = { year, month, username, New_add_index };
        string[] select_List = { "management", "affair_gonghui", "affair_dangzu", "affair_tuanzu", "examine", "kaoqin", "other", "remark" };
        string[] data        = new string[8];
        st.select_delete("Daily_Manage", data, list, source, select_List);

        //text框赋值
        add_management.Text = data[0]; //部门内部日常管理
        add_affair.Text     = data[1]; //工会事务
        add_affair2.Text    = data[2]; //党组事务
        add_affair3.Text    = data[3]; //团组事务
        add_examine.Text    = data[4]; //体系内审/外审
        add_check.Text      = data[5]; //考勤
        add_others.Text     = data[6]; //其他报销
        add_remarks.Text    = data[7]; //备注
    }
예제 #4
0
    //修改内容拉取
    protected void add_Click(object sender, EventArgs e)
    {
        sqlTable st = new sqlTable();

        //网页输入
        string New_add_index = add_index.Text.Trim(); // 索引

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

        //查找索引是否存在
        string[] listNumber      = { "year", "month", "username", "number" };
        string[] sourceNumber    = { year, month, username, New_add_index };
        string[] selectNumber    = { "number" };
        string   tableNameNumber = "Programing_Picture";

        string[] resNumber = new string[1];
        st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
        if (New_add_index != resNumber[0])
        {
            Response.Write("<script>alert('填写序号有误')</script>");
            return;
        }

        //查找原来日常工作量当月汇总
        string[] list        = { "year", "month", "username", "number" };
        string[] source      = { year, month, username, New_add_index };
        string[] select_List = { "project_name", "digital_number", "analog_number", "programing_picture", "programing_day", "month_day", "remark" };
        string[] data        = new string[7];
        st.select_delete("Programing_Picture", data, list, source, select_List);

        //text框赋值
        add_engineName.Text   = data[0]; //项目名称
        add_onOffNum.Text     = data[1]; //总开关量点数
        add_modeNum.Text      = data[2]; //总模拟量点数
        add_program.Value     = data[3]; //编程/画面
        add_allDays.Text      = data[4]; //总工日数
        add_finishedDays.Text = data[5]; //本月完成工日数
        add_remarks.Text      = data[6]; //备注
    }
예제 #5
0
    //修改内容拉取
    protected void add_Click(object sender, EventArgs e)
    {
        sqlTable st = new sqlTable();

        //网页输入
        string New_add_index = add_index.Text.Trim(); // 索引
        //获取年月日以及用户名
        string year     = DateTime.Now.Year.ToString();
        string month    = DateTime.Now.Month.ToString();
        string username = HttpContext.Current.Session["username"].ToString();

        //查找索引是否存在
        string[] listNumber      = { "year", "month", "username", "number" };
        string[] sourceNumber    = { year, month, username, New_add_index };
        string[] selectNumber    = { "number" };
        string   tableNameNumber = "Debug";

        string[] resNumber = new string[1];
        st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
        if (New_add_index != resNumber[0])
        {
            Response.Write("<script>alert('填写序号有误')</script>");
            return;
        }

        //查找原来日常工作量当月汇总
        string[] list        = { "year", "month", "username", "number" };
        string[] source      = { year, month, username, New_add_index };
        string[] select_List = { "projectname", "site", "manageday", "debugday", "remark" };
        string[] data        = new string[5];
        st.select_delete("Debug", data, list, source, select_List);

        //text框赋值
        add_engineName.Text  = data[0]; //项目名称
        add_enginePlace.Text = data[1]; //项目地点
        add_manageDays.Text  = data[2]; //本月工程管理天数
        add_debugDays.Text   = data[3]; //本月调试天数
        add_remarks.Text     = data[4]; //备注
    }
예제 #6
0
        //修改内容拉取
        protected void add_Click(object sender, EventArgs e)
        {
            sqlTable st = new sqlTable();

            //网页输入
            string New_add_index = add_index.Text.Trim(); // 索引
                                                          //获取年月日以及用户名
            string year     = DateTime.Now.Year.ToString();
            string month    = DateTime.Now.Month.ToString();
            string username = HttpContext.Current.Session["username"].ToString();

            //查找索引是否存在
            string[] listNumber      = { "year", "month", "username", "number" };
            string[] sourceNumber    = { year, month, username, New_add_index };
            string[] selectNumber    = { "number" };
            string   tableNameNumber = "LingXing";

            string[] resNumber = new string[1];
            st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
            if (New_add_index != resNumber[0])
            {
                Response.Write("<script>alert('填写序号有误')</script>");
                return;
            }

            //查找原来日常工作量当月汇总
            string[] list        = { "year", "month", "username", "number" };
            string[] source      = { year, month, username, New_add_index };
            string[] select_List = { "chuchai_day", "jiaoliu_day", "other_day", "remark" };
            string[] data        = new string[4];
            st.select_delete("LingXing", data, list, source, select_List);

            //text框赋值
            add_business.Text  = data[0]; //本月出差天数
            add_technical.Text = data[1]; //技术交流天数
            add_others.Text    = data[2]; //其他零星工日
            add_remarks.Text   = data[3]; //备注
        }
예제 #7
0
        //月份
        protected void submit_Click(object sender, EventArgs e)
        {
            sqlTable ste    = new sqlTable();
            string   monthm = Request.Form["month"].ToString();

            HttpContext.Current.Session["months"] = monthm;//月份
            string tableName = "Summary_Month";

            string[] mysql   = new string[1];
            string[] list    = { "year", "month" };
            string[] source  = { DateTime.Now.Year.ToString(), monthm };
            string[] columns = { "summary" };
            ste.select_delete(tableName, mysql, list, source, columns);
            HttpContext.Current.Session["numberMonth"] = mysql[0];
            Page_Load(sender, e);
        }
예제 #8
0
        //按年查看员工汇总
        protected void person_submit_Click(object sender, EventArgs e)
        {
            sqlTable ste   = new sqlTable();
            string   yeary = Request.Form["person_year"].ToString();

            HttpContext.Current.Session["yearuser"] = yeary;
            string tableName = "Summary_Year";

            string[] mysql   = new string[1];
            string[] list    = { "year" };
            string[] source  = { yeary };
            string[] columns = { "Ysummary" };
            ste.select_delete(tableName, mysql, list, source, columns);
            HttpContext.Current.Session["userYear"] = mysql[0];
            Page_Load(sender, e);
        }
예제 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        sqlTable st = new sqlTable();
        //获取年月日以及用户名,小组
        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();

        //网页输入
        //string New_add_workDays = add_workDays.Text.Trim();//本月工作日之和

        //列名以及数据源
        string[] list        = { "year", "month", "username", "team" };
        string[] source      = { year, month, username, team };
        string[] rest        = { "" };
        string[] selectLitst = { "work_day" };
        //查找
        st.select_delete("Summary", rest, list, source, selectLitst);
        add_workDays.Text = rest[0];
    }
예제 #10
0
    // 修改事件
    protected void modifybtn_Click(object sender, EventArgs e)
    {
        sqlTable st = new sqlTable();

        //获取年月日以及用户名,小组
        string year     = DateTime.Now.Year.ToString();
        string month    = DateTime.Now.Month.ToString();
        string username = HttpContext.Current.Session["username"].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();    //备注

        //查找索引是否存在
        string[] listNumber      = { "year", "month", "username", "number" };
        string[] sourceNumber    = { year, month, username, New_add_index };
        string[] selectNumber    = { "number" };
        string   tableNameNumber = "Daily_Manage";

        string[] resNumber = new string[1];
        st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
        if (New_add_index != resNumber[0])
        {
            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);
        }

        //更新列名以及数据源
        string[] list   = { "management", "affair_gonghui", "affair_dangzu", "affair_tuanzu", "examine", "kaoqin", "other", "month_day", "remark" };
        string[] source = { 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 };

        //查找列名以及数据源
        string[] selectList   = { "year", "month", "username", "number" };
        string[] selectSource = { year, month, username, New_add_index };

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

        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>");
        }
    }
예제 #11
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>");
            }
        }
예제 #12
0
        //修改事件
        protected void modifybtn_Click(object sender, EventArgs e)
        {
            sqlTable st = new sqlTable();

            //获取年月日以及用户名,小组
            string year     = DateTime.Now.Year.ToString();
            string month    = DateTime.Now.Month.ToString();
            string username = HttpContext.Current.Session["username"].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_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();     //备注

            //查找索引是否存在
            string[] listNumber      = { "year", "month", "username", "number" };
            string[] sourceNumber    = { year, month, username, New_add_index };
            string[] selectNumber    = { "number" };
            string   tableNameNumber = "Manage_Working";

            string[] resNumber = new string[1];
            st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
            if (New_add_index != resNumber[0])
            {
                Response.Write("<script>alert('填写序号有误')</script>");
                return;
            }

            //更新列名以及数据源
            string[] list   = { "project_name", "xunjia_baojia", "tender", "sign", "toubiao", "equip", "test", "cuikuan", "contract", "other", "PM_day", "remark" };
            string[] source = { 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 };

            //查找列名以及数据源
            string[] selectList   = { "year", "month", "username", "number" };
            string[] selectSource = { year, month, username, New_add_index };

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

            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>");
            }
        }
예제 #13
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>");
            }
        }
예제 #14
0
        //修改事件
        protected void modifybtn_Click(object sender, EventArgs e)
        {
            sqlTable st = new sqlTable();

            //获取年月日以及用户名,小组
            string year     = DateTime.Now.Year.ToString();
            string month    = DateTime.Now.Month.ToString();
            string username = HttpContext.Current.Session["username"].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_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();   //备注

            //查找索引是否存在
            string[] listNumber      = { "year", "month", "username", "number" };
            string[] sourceNumber    = { year, month, username, New_add_index };
            string[] selectNumber    = { "number" };
            string   tableNameNumber = "LingXing";

            string[] resNumber = new string[1];
            st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
            if (New_add_index != resNumber[0])
            {
                Response.Write("<script>alert('填写序号有误')</script>");
                return;
            }

            //更新列名以及数据源
            string[] list   = { "chuchai_day", "jiaoliu_day", "other_day", "remark" };
            string[] source = { New_add_business, New_add_technical, New_add_others, New_add_remarks };

            //查找列名以及数据源
            string[] selectList   = { "year", "month", "username", "number" };
            string[] selectSource = { year, month, username, New_add_index };

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

            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>");
            }
        }
예제 #15
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>");
        }
    }
예제 #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (HttpContext.Current.Session["username"].ToString() == "null" || HttpContext.Current.Session["userpwd"].ToString() == "null")
            {
                HttpContext.Current.Response.Write(" <script> alert( '您还未登陆,请先登录!!!');window.location.href= 'Default.aspx ' </script> ");
            }
            string name = HttpContext.Current.Session["name"].ToString();
            Response.Write(" <script>window.onload=function(){ var name=document.getElementById('name'); name.innerHTML='欢迎你," + name + "'} </script> ");
        }
        catch (Exception)
        {
            HttpContext.Current.Response.Write(" <script> alert( '您还未登陆,请先登录!!!');window.location.href= 'Default.aspx ' </script> ");
        }

        sqlTable st = new sqlTable();

        #region 设计工作量
        string   designTableName1  = "Design";                                                                                                                                                                                                                                                          //表名1
        string   designTableName2  = "Login";                                                                                                                                                                                                                                                           //表名2
        string[] designSourceList  = { "Design.number", "Login.name", "Design.project_number", "Design.project_name", "Design.drawing_number", "Design.A1_number", "Design.zhehe_working_day", "Design.month_day", "Design.program_day", "Design.basic_design_day", "Design.leader", "Design.remark" }; //查看列名
        string[] designSelectList  = { "year", "month", "Design.username" };                                                                                                                                                                                                                            //限定列名
        string[] designSelectValue = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" };                                                                                                                                                                                 //限定列值

        //连接数据查看并显示在网页
        designDt = st.selectAll(designTableName1, designTableName2, designSourceList, designSelectList, designSelectValue);
        if (designDt != null)
        {
            Design_Repeater.DataSource = designDt;
            Design_Repeater.DataBind();
        }
        #endregion

        #region 编程/画面工作量
        string   programTableName1  = "Programing_Picture";                                                                                                                                                                                                                                                                                 //表名1
        string   programTableName2  = "Login";                                                                                                                                                                                                                                                                                              //表名2
        string[] programSourceList  = { "Programing_Picture.number", "Login.name", "Programing_Picture.project_name", "Programing_Picture.digital_number", "Programing_Picture.analog_number", "Programing_Picture.programing_picture", "Programing_Picture.programing_day", "Programing_Picture.month_day", "Programing_Picture.remark" }; //查看列名
        string[] programSelectList  = { "year", "month", "Programing_Picture.username" };                                                                                                                                                                                                                                                   //限定列名
        string[] programSelectValue = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" };                                                                                                                                                                                                                    //限定列值

        //连接数据查看并显示在网页
        programCmd = st.selectAll(programTableName1, programTableName2, programSourceList, programSelectList, programSelectValue);
        if (programCmd != null)
        {
            Programming_Picture_Repeater.DataSource = programCmd;
            Programming_Picture_Repeater.DataBind();
        }
        #endregion

        #region 调试/工程管理工作量
        string   debugTableName1  = "Debug";                                                                                                                  //表名1
        string   debugTableName2  = "Login";                                                                                                                  //表名2
        string[] debugSourceList  = { "Debug.number", "Login.name", "Debug.projectname", "Debug.site", "Debug.manageday", "Debug.debugday", "Debug.remark" }; //查看列名
        string[] debugSelectList  = { "year", "month", "Debug.username" };                                                                                    //限定列名
        string[] debugSelectValue = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" };                                        //限定列值

        //连接数据查看并显示在网页
        System.Data.DataTable debugCmd = st.selectAll(debugTableName1, debugTableName2, debugSourceList, debugSelectList, debugSelectValue);
        if (debugCmd != null)
        {
            Debug_Repeater.DataSource = debugCmd;
            Debug_Repeater.DataBind();
        }
        #endregion

        #region 经营工作量
        string   manageWorkingTableName1  = "Manage_Working";                                                                                                                                                                                                                                                                                                                                                 //表名1
        string   manageWorkingTableName2  = "Login";                                                                                                                                                                                                                                                                                                                                                          //表名2
        string[] manageWorkingSourceList  = { "Manage_Working.number", "Login.name", "Manage_Working.project_name", "Manage_Working.xunjia_baojia", "Manage_Working.tender", "Manage_Working.sign", "Manage_Working.toubiao", "Manage_Working.equip", "Manage_Working.test", "Manage_Working.cuikuan", "Manage_Working.contract", "Manage_Working.other", "Manage_Working.PM_day", "Manage_Working.remark" }; //查看列名
        string[] manageWorkingSelectList  = { "year", "month", "Manage_Working.username" };                                                                                                                                                                                                                                                                                                                   //限定列名
        string[] manageWorkingSelectValue = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" };                                                                                                                                                                                                                                                                                //限定列值

        //连接数据查看并显示在网页
        System.Data.DataTable manageWorkingCmd = st.selectAll(manageWorkingTableName1, manageWorkingTableName2, manageWorkingSourceList, manageWorkingSelectList, manageWorkingSelectValue);
        if (manageWorkingCmd != null)
        {
            Manage_Working_Repeater.DataSource = manageWorkingCmd;
            Manage_Working_Repeater.DataBind();
        }
        #endregion

        #region 日常管理工作量
        string DailyManageTableName1 = "Daily_Manage";                                                                                                                                                                                                                                                                         //表名1
        string DailyManageTableName2 = "Login";                                                                                                                                                                                                                                                                                //表名2

        string[] DailyManageSourceList  = { "Daily_Manage.number", "Login.name", "Daily_Manage.management", "Daily_Manage.affair_gonghui", "Daily_Manage.affair_dangzu", "Daily_Manage.affair_tuanzu", "Daily_Manage.examine", "Daily_Manage.kaoqin", "Daily_Manage.other", "Daily_Manage.month_day", "Daily_Manage.remark" }; //查看列名
        string[] DailyManageSelectList  = { "year", "month", "Daily_Manage.username" };                                                                                                                                                                                                                                        //限定列名
        string[] DailyManageSelectValue = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" };                                                                                                                                                                                                   //限定列值

        //连接数据查看并显示在网页
        System.Data.DataTable DailyManageCmd = st.selectAll(DailyManageTableName1, DailyManageTableName2, DailyManageSourceList, DailyManageSelectList, DailyManageSelectValue);
        if (DailyManageCmd != null)
        {
            Daily_Manage_Repeater.DataSource = DailyManageCmd;
            Daily_Manage_Repeater.DataBind();
        }
        #endregion

        #region 零星工日
        string lingXingTableName1 = "LingXing";                                                                                                                      //表名1
        string lingXingTableName2 = "Login";                                                                                                                         //表名2

        string[] lingXingSourceList  = { "LingXing.number", "Login.name", "LingXing.chuchai_day", "LingXing.jiaoliu_day", "LingXing.other_day", "LingXing.remark" }; //查看列名
        string[] lingXingSelectList  = { "year", "month", "LingXing.username" };                                                                                     //限定列名
        string[] lingXingSelectValue = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" };                                            //限定列值

        //连接数据查看并显示在网页
        System.Data.DataTable lingXingCmd = st.selectAll(lingXingTableName1, lingXingTableName2, lingXingSourceList, lingXingSelectList, lingXingSelectValue);
        if (lingXingCmd != null)
        {
            LingXing_Repeater.DataSource = lingXingCmd;
            LingXing_Repeater.DataBind();
        }
        #endregion

        #region 本月工日之和
        string summaryTableName1 = "Summary";                                                                             //表名
        string summaryTableName2 = "Login";                                                                               //表名2
        string summaryTableName3 = "Jiediao";                                                                             //表名3
        string summaryTableName4 = "Summary_Month";                                                                       //表名4

        string[] summarySourceList  = { "Login.name", "Summary.work_day" };                                               //查看列名
        string[] summarySourceList2 = { "Login.name", "Jiediao.transfer" };                                               //查看列名2

        string[] summarySelectList  = { "year", "month", "Summary.username" };                                            //限定列名
        string[] summarySelectList2 = { "year", "month", "Jiediao.username" };                                            //限定列名2

        string[] summarySelectValue  = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" }; //限定列值
        string[] summarySelectValue2 = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" }; //限定列值2


        //连接数据查看并显示在网页
        DataTable summaryCmd = st.selectAll6(summaryTableName2, summaryTableName1, summaryTableName3, summaryTableName4, summarySourceList, summarySelectList, summarySelectValue, summarySourceList2, summarySelectList2, summarySelectValue2);
        if (summaryCmd != null)
        {
            Summary_Repeater.DataSource = summaryCmd;
            Summary_Repeater.DataBind();
        }
        #endregion

        #region 合计
        string   tableName = "Summary_Month";
        string[] mysqlm    = new string[1];
        string[] listm     = { "year", "month" };
        string[] sourcem   = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString() };
        string[] columnsm  = { "summary" };
        st.select_delete(tableName, mysqlm, listm, sourcem, columnsm);
        HttpContext.Current.Session["numberMonth"] = mysqlm[0];
        #endregion
    }
예제 #17
0
    //修改事件
    protected void modifybtn_Click(object sender, EventArgs e)
    {
        sqlTable st = new sqlTable();

        //获取年月日以及用户名
        string year     = DateTime.Now.Year.ToString();
        string month    = DateTime.Now.Month.ToString();
        string username = HttpContext.Current.Session["username"].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;
        }

        //借调判断
        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_engineName  = add_engineName.Text.Trim();  //项目名称
        String New_add_enginePlace = add_enginePlace.Text.Trim(); //项目地点
        String New_add_manageDays  = add_manageDays.Text.Trim();  //本月工程管理天数
        String New_add_debugDays   = add_debugDays.Text.Trim();   //本月调试天数
        String New_add_remarks     = add_remarks.Text.Trim();     //备注

        //查找索引是否存在
        string[] listNumber      = { "year", "month", "username", "number" };
        string[] sourceNumber    = { year, month, username, New_add_index };
        string[] selectNumber    = { "number" };
        string   tableNameNumber = "Debug";

        string[] resNumber = new string[1];
        st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
        if (New_add_index != resNumber[0])
        {
            Response.Write("<script>alert('填写序号有误')</script>");
            return;
        }

        //更新列名以及数据源
        string[] list   = { "projectname", "site", "manageday", "debugday", "remark" };
        string[] source = { New_add_engineName, New_add_enginePlace, New_add_manageDays, New_add_debugDays, New_add_remarks };

        //查找列名以及数据源
        string[] selectList   = { "year", "month", "username", "number" };
        string[] selectSource = { year, month, username, New_add_index };

        int res = st.table_update("Debug", list, source, selectList, selectSource);

        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>");
        }
    }
예제 #18
0
        //修改事件
        protected void modifybtn_Click(object sender, EventArgs e)
        {
            sqlTable st = new sqlTable();

            //获取年月日以及用户名,小组
            string year     = DateTime.Now.Year.ToString();
            string month    = DateTime.Now.Month.ToString();
            string username = HttpContext.Current.Session["username"].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_engine       = add_engine.Text.Trim();       //工程号
            String New_add_engineName   = add_engineName.Text.Trim();   //工程名称
            String New_add_paperPage    = add_paperPage.Text.Trim();    //图纸张数
            String New_add_al           = add_al.Text.Trim();           //折合Al
            String New_add_allDays      = add_allDays.Text.Trim();      //折合总工日数
            String New_add_finishedDays = add_finishedDays.Text.Trim(); //本月完成工日数
            String New_add_usedDays     = add_usedDays.Text.Trim();     //技术方案工作量所用工日数
            String New_add_usedDays2    = add_usedDays2.Text.Trim();    //基本设计工作量所用工日数
            String New_add_leaderDays   = add_leaderDays.Text.Trim();   //工日
            String New_add_remarks      = add_remarks.Text.Trim();      //备注

            //查找索引是否存在
            string[] listNumber      = { "year", "month", "username", "number" };
            string[] sourceNumber    = { year, month, username, New_add_index };
            string[] selectNumber    = { "number" };
            string   tableNameNumber = "Design";

            string[] resNumber = new string[1];
            st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
            if (New_add_index != resNumber[0])
            {
                Response.Write("<script>alert('填写序号有误')</script>");
                return;
            }

            //更新列名以及数据源
            string[] list   = { "project_number", "project_name", "drawing_number", "A1_number", "zhehe_working_day", "month_day", "program_day", "basic_design_day", "leader", "remark" };
            string[] source = { New_add_engine, New_add_engineName, New_add_paperPage, New_add_al, New_add_allDays, New_add_finishedDays, New_add_usedDays, New_add_usedDays2, New_add_leaderDays, New_add_remarks };

            //查找列名以及数据源
            string[] selectList   = { "year", "month", "username", "number" };
            string[] selectSource = { year, month, username, New_add_index };

            //插入
            int res = st.table_update("Design", list, source, selectList, selectSource);

            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>");
            }
        }
예제 #19
0
    //删除事件
    protected void delete_Click(object sender, EventArgs e)
    {
        sqlTable st = new sqlTable();

        //获取年月日以及用户名,小组
        string year     = DateTime.Now.Year.ToString();
        string month    = DateTime.Now.Month.ToString();
        string username = HttpContext.Current.Session["username"].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[] listNumber      = { "year", "month", "username", "number" };
        string[] sourceNumber    = { year, month, username, New_add_index };
        string[] selectNumber    = { "number" };
        string   tableNameNumber = "Programing_Picture";

        string[] resNumber = new string[1];
        st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
        if (New_add_index != resNumber[0])
        {
            Response.Write("<script>alert('填写序号有误')</script>");
            return;
        }

        //查找原来日常工作量当月汇总
        string[] list6   = { "year", "month", "username", "number" };
        string[] source6 = { year, month, username, New_add_index };
        int      res     = st.table_delete("Programing_Picture", list6, source6);

        #region 修改number值
        string[] tableName = { "Daily_Manage", "Debug", "Design", "LingXing", "Manage_Working", "Programing_Picture" };
        string[] columns   = { "number" };
        String[,] temp  = new String[30, 1];
        String[,] temp1 = new String[30, 1];
        string[] xianding = { "year", "month", "username" };
        string[] xdValue  = { year, month, username };

        for (int k = 0; k < tableName.Length; k++)
        {
            for (int j = 0; j < temp.Length; j++)
            {
                temp[j, 0] = null;
            }
            //st.page_flash(temp, tableName[k], columns);//tableName[i]
            st.selecet_number(temp, tableName[k], columns, xianding, xdValue);
            for (int i = 0; i < temp.GetLength(0); i++)
            {
                if (temp[i, 0] == null)
                {
                    break;
                }
                if (int.Parse(temp[i, 0]) > int.Parse(New_add_index))
                {
                    temp1[i, 0] = temp[i, 0];
                    temp[i, 0]  = (int.Parse(temp[i, 0]) - 1).ToString();
                    string[] temp2 = new string[1];
                    temp2[0] = temp[i, 0];
                    string[] upsource = { year, month, username, temp1[i, 0] };
                    st.table_update(tableName[k], columns, temp2, list6, upsource);
                }
            }
        }
        #endregion

        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>");
        }
    }
예제 #20
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>");
        }
    }
예제 #21
0
    //修改事件
    protected void modifybtn_Click(object sender, EventArgs e)
    {
        sqlTable st = new sqlTable();

        //获取年月日以及用户名,小组
        string year     = DateTime.Now.Year.ToString();
        string month    = DateTime.Now.Month.ToString();
        string username = HttpContext.Current.Session["username"].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_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();                       //备注

        //查找索引是否存在
        string[] listNumber      = { "year", "month", "username", "number" };
        string[] sourceNumber    = { year, month, username, New_add_index };
        string[] selectNumber    = { "number" };
        string   tableNameNumber = "Programing_Picture";

        string[] resNumber = new string[1];
        st.select_delete(tableNameNumber, resNumber, listNumber, sourceNumber, selectNumber);
        if (New_add_index != resNumber[0])
        {
            Response.Write("<script>alert('填写序号有误')</script>");
            return;
        }

        //更新列名以及数据源
        string[] list   = { "project_name", "digital_number", "analog_number", "programing_picture", "programing_day", "month_day", "remark" };
        string[] source = { New_add_engineName, New_add_onOffNum, New_add_modeNum, New_add_program, New_add_allDays, New_add_finishedDays, New_add_remarks };

        //查找列名以及数据源
        string[] selectList   = { "year", "month", "username", "number" };
        string[] selectSource = { year, month, username, New_add_index };

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

        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>");
        }
    }
예제 #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 登录判断
            try
            {
                if (HttpContext.Current.Session["username"].ToString() == "null" || HttpContext.Current.Session["userpwd"].ToString() == "null")
                {
                    HttpContext.Current.Response.Write(" <script> alert( '您还未登陆,请先登录!!!');window.parent.location.href= '../Default.aspx ' </script> ");
                }
                string name = HttpContext.Current.Session["name"].ToString();
            }
            catch (Exception)
            {
                HttpContext.Current.Response.Write(" <script> alert( '您还未登陆,请先登录!!!');window.parent.location.href= '../Default.aspx ' </script> ");
            }
            #endregion

            #region 设计工作量
            string   designTableName1  = "Design";                                                                                                                                                                                                                                                          //表名1
            string   designTableName2  = "Login";                                                                                                                                                                                                                                                           //表名2
            string[] designSourceList  = { "Design.number", "Login.name", "Design.project_number", "Design.project_name", "Design.drawing_number", "Design.A1_number", "Design.zhehe_working_day", "Design.month_day", "Design.program_day", "Design.basic_design_day", "Design.leader", "Design.remark" }; //查看列名
            string[] designSelectList  = { "year", "month", "Design.username" };                                                                                                                                                                                                                            //限定列名
            string[] designSelectValue = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" };                                                                                                                                                                                 //限定列值

            //连接数据查看并显示在网页
            designCmd = sqlt.selectAll(designTableName1, designTableName2, designSourceList, designSelectList, designSelectValue);

            #endregion

            #region 编程/画面工作量
            string   programTableName1  = "Programing_Picture";                                                                                                                                                                                                                                                                                 //表名1
            string   programTableName2  = "Login";                                                                                                                                                                                                                                                                                              //表名2
            string[] programSourceList  = { "Programing_Picture.number", "Login.name", "Programing_Picture.project_name", "Programing_Picture.digital_number", "Programing_Picture.analog_number", "Programing_Picture.programing_picture", "Programing_Picture.programing_day", "Programing_Picture.month_day", "Programing_Picture.remark" }; //查看列名
            string[] programSelectList  = { "year", "month", "Programing_Picture.username" };                                                                                                                                                                                                                                                   //限定列名
            string[] programSelectValue = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" };                                                                                                                                                                                                                    //限定列值

            //连接数据查看并显示在网页
            programCmd = sqlt.selectAll(programTableName1, programTableName2, programSourceList, programSelectList, programSelectValue);
            //if (programCmd != null)
            //{
            //    Programming_Picture_Repeater.DataSource = programCmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
            //    Programming_Picture_Repeater.DataBind();
            //}
            #endregion

            #region 调试/工程管理工作量
            string   debugTableName1  = "Debug";                                                                                                                  //表名1
            string   debugTableName2  = "Login";                                                                                                                  //表名2
            string[] debugSourceList  = { "Debug.number", "Login.name", "Debug.projectname", "Debug.site", "Debug.manageday", "Debug.debugday", "Debug.remark" }; //查看列名
            string[] debugSelectList  = { "year", "month", "Debug.username" };                                                                                    //限定列名
            string[] debugSelectValue = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" };                                        //限定列值

            //连接数据查看并显示在网页
            debugCmd = sqlt.selectAll(debugTableName1, debugTableName2, debugSourceList, debugSelectList, debugSelectValue);
            //if (debugCmd != null)
            //{
            //    Debug_Repeater.DataSource = debugCmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
            //    Debug_Repeater.DataBind();
            //}
            #endregion

            #region 经营工作量
            string   manageWorkingTableName1  = "Manage_Working";                                                                                                                                                                                                                                                                                                                                                 //表名1
            string   manageWorkingTableName2  = "Login";                                                                                                                                                                                                                                                                                                                                                          //表名2
            string[] manageWorkingSourceList  = { "Manage_Working.number", "Login.name", "Manage_Working.project_name", "Manage_Working.xunjia_baojia", "Manage_Working.tender", "Manage_Working.sign", "Manage_Working.toubiao", "Manage_Working.equip", "Manage_Working.test", "Manage_Working.cuikuan", "Manage_Working.contract", "Manage_Working.other", "Manage_Working.PM_day", "Manage_Working.remark" }; //查看列名
            string[] manageWorkingSelectList  = { "year", "month", "Manage_Working.username" };                                                                                                                                                                                                                                                                                                                   //限定列名
            string[] manageWorkingSelectValue = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" };                                                                                                                                                                                                                                                                                //限定列值

            //连接数据查看并显示在网页
            manageWorkingCmd = sqlt.selectAll(manageWorkingTableName1, manageWorkingTableName2, manageWorkingSourceList, manageWorkingSelectList, manageWorkingSelectValue);
            //if (manageWorkingCmd != null)
            //{
            //    Manage_Working_Repeater.DataSource = manageWorkingCmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
            //    Manage_Working_Repeater.DataBind();
            //}
            #endregion

            #region 日常管理工作量
            string DailyManageTableName1 = "Daily_Manage";                                                                                                                                                                                                                                               //表名1
            string DailyManageTableName2 = "Login";                                                                                                                                                                                                                                                      //表名2

            string[] DailyManageSourceList  = { "Daily_Manage.number", "Login.name", "Daily_Manage.management", "Daily_Manage.affair_gonghui", "Daily_Manage.affair_dangzu", "Daily_Manage.affair_tuanzu", "Daily_Manage.examine", "Daily_Manage.kaoqin", "Daily_Manage.other", "Daily_Manage.remark" }; //查看列名
            string[] DailyManageSelectList  = { "year", "month", "Daily_Manage.username" };                                                                                                                                                                                                              //限定列名
            string[] DailyManageSelectValue = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" };                                                                                                                                                                         //限定列值

            //连接数据查看并显示在网页
            DailyManageCmd = sqlt.selectAll(DailyManageTableName1, DailyManageTableName2, DailyManageSourceList, DailyManageSelectList, DailyManageSelectValue);
            //if (DailyManageCmd != null)
            //{
            //    Daily_Manage_Repeater.DataSource = DailyManageCmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
            //    Daily_Manage_Repeater.DataBind();
            //}
            #endregion

            #region 零星工日
            string lingXingTableName1 = "LingXing";                                                                                                                      //表名1
            string lingXingTableName2 = "Login";                                                                                                                         //表名2

            string[] lingXingSourceList  = { "LingXing.number", "Login.name", "LingXing.chuchai_day", "LingXing.jiaoliu_day", "LingXing.other_day", "LingXing.remark" }; //查看列名
            string[] lingXingSelectList  = { "year", "month", "LingXing.username" };                                                                                     //限定列名
            string[] lingXingSelectValue = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" };                                            //限定列值

            //连接数据查看并显示在网页
            lingXingCmd = sqlt.selectAll(lingXingTableName1, lingXingTableName2, lingXingSourceList, lingXingSelectList, lingXingSelectValue);
            //if (lingXingCmd != null)
            //{
            //    LingXing_Repeater.DataSource = lingXingCmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
            //    LingXing_Repeater.DataBind();
            //}
            #endregion

            #region 本月工日之和
            string summaryTableName1 = "Summary";       //表名
            string summaryTableName2 = "Login";         //表名2
            string summaryTableName3 = "Jiediao";       //表名3
            string summaryTableName4 = "Summary_Month"; //表名4


            string[] summarySourceList  = { "Login.peoplenumber", "Login.name", "Summary.work_day", "Summary.ratio" };        //查看列名
            string[] summarySourceList2 = { "Login.peoplenumber", "Login.name", "Jiediao.transfer", "Jiediao.ratio" };        //查看列名2

            string[] summarySelectList  = { "year", "month", "Summary.username" };                                            //限定列名
            string[] summarySelectList2 = { "year", "month", "Jiediao.username" };                                            //限定列名2

            string[] summarySelectValue  = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" }; //限定列值
            string[] summarySelectValue2 = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), "Login.username" }; //限定列值2

            //连接数据
            summaryCmd = sqlt.selectAll7(summaryTableName2, summaryTableName1, summaryTableName3, summaryTableName4, summarySourceList, summarySelectList, summarySelectValue, summarySourceList2, summarySelectList2, summarySelectValue2);

            #endregion

            #region 数据绑定
            if (!Page.IsPostBack)//必须有,规定数据不能多次被绑定。
            {
                //设计工作量
                Design_Repeater.DataSource = designCmd;
                Design_Repeater.DataBind();

                //编程/画面工作量
                Programming_Picture_Repeater.DataSource = programCmd;
                Programming_Picture_Repeater.DataBind();

                //调试/工程管理工作量
                Debug_Repeater.DataSource = debugCmd;
                Debug_Repeater.DataBind();

                //经营工作量
                Manage_Working_Repeater.DataSource = manageWorkingCmd;
                Manage_Working_Repeater.DataBind();

                //日常管理工作量
                Daily_Manage_Repeater.DataSource = DailyManageCmd;
                Daily_Manage_Repeater.DataBind();

                //零星工日
                LingXing_Repeater.DataSource = lingXingCmd;
                LingXing_Repeater.DataBind();

                //本月工日之和
                Summary_Repeater.DataSource = summaryCmd;
                Summary_Repeater.DataBind();
            }
            #endregion

            #region 合计
            string   tableName = "Summary_Month";
            string[] mysqlm    = new string[1];
            string[] listm     = { "year", "month" };
            string[] sourcem   = { DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString() };
            string[] columnsm  = { "summary" };
            sqlt.select_delete(tableName, mysqlm, listm, sourcem, columnsm);
            HttpContext.Current.Session["numberMonth"] = mysqlm[0];
            #endregion
        }