Exemple #1
0
        //插入修改信息表
        public int insertAlterRecordTable(DataTable dt, string table, JObject json)
        {
            string change            = "change";
            Base_Codename_Method bcm = new Base_Codename_Method();
            string contants          = bcm.getChange(dt, json, table);
            string sql = sc.get_base_sql(change, table, json, contants);
            int    i   = DBMgrBase.ExecuteNonQuery(sql);

            return(i);
        }
        private void save_recorddetails()
        {
            string  recordinfoid = Request["recordinfoid"];
            string  formdata     = Request["formdata"];
            JObject json         = (JObject)JsonConvert.DeserializeObject(formdata);

            Sql.busi_RecordInfor br = new Sql.busi_RecordInfor();
            Base_Codename_Method bm = new Base_Codename_Method();
            string response         = String.Empty;

            if (string.IsNullOrEmpty(json.Value <string>("ID")))
            {
                if (json.Value <string>("ENABLED") == "1")
                {
                    if (br.check_repeat_record_details(json, recordinfoid).Rows.Count > 0)
                    {
                        //当数据有重复时success返回值为4
                        response = "{\"success\":\"4\"}";
                    }
                    else
                    {
                        int i = br.insert_record_details(recordinfoid, json);
                        response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                    }
                }
                else
                {
                    int i = br.insert_record_details(recordinfoid, json);
                    response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                }
            }
            else
            {
                if (json.Value <string>("ENABLED") == "1")
                {
                    if (br.check_update_repeat_record_details(json, recordinfoid).Rows.Count > 0)
                    {
                        //当数据有重复时success返回值为4
                        response = "{\"success\":\"4\"}";
                    }
                    else
                    {
                        //更新
                        DataTable dt = br.get_before_change_record_details(json);
                        int       i  = br.update_record_details(json, recordinfoid);
                        if (i > 0)
                        {
                            string content = bm.getrecordinfodetails(dt, json);
                            br.insert_alert_record_details(json, content);
                            response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                        }
                    }
                }
                else
                {
                    //更新
                    DataTable dt = br.get_before_change_record_details(json);
                    int       i  = br.update_record_details(json, recordinfoid);
                    if (i > 0)
                    {
                        string content = bm.getrecordinfodetails(dt, json);
                        br.insert_alert_record_details(json, content);
                        response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                    }
                }
            }
            Response.Write(response);
            Response.End();
        }
        private void save(string formdata)
        {
            JObject json = (JObject)JsonConvert.DeserializeObject(formdata);

            Sql.busi_RecordInfor br = new Sql.busi_RecordInfor();
            string response         = String.Empty;
            Base_Codename_Method bm = new Base_Codename_Method();

            if (string.IsNullOrEmpty(json.Value <string>("ID")))
            {
                //查询是否有重复值
                if (json.Value <string>("ENABLED") == "1")
                {
                    if (br.check_sys_recordinfo(json).Tables[0].Rows.Count > 0)
                    {
                        response = "{\"success\":\"4\"}";
                    }
                    else
                    {
                        int i = br.insert_sys_recordinfo(json);
                        response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                    }
                }
                else
                {
                    int i = br.insert_sys_recordinfo(json);
                    response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                }
            }
            else
            {
                //更新
                if (json.Value <string>("ENABLED") == "1")
                {
                    if (br.update_check_sys_recordinfo(json).Rows.Count > 0)
                    {
                        //当数据有重复时success返回值为4
                        response = "{\"success\":\"4\"}";
                    }
                    else
                    {
                        DataTable dt = br.Before_Change(json);
                        int       i  = br.update_sys_recordinfo(json);
                        if (i > 0)
                        {
                            string content = bm.getrecordinfor(dt, json);
                            br.saveChanges_recordinfo(json, content);
                            response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                        }
                    }
                }
                else
                {
                    DataTable dt = br.Before_Change(json);
                    int       i  = br.update_sys_recordinfo(json);
                    if (i > 0)
                    {
                        string content = bm.getrecordinfor(dt, json);
                        br.saveChanges_recordinfo(json, content);
                        response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                    }
                }
            }

            Response.Write(response);
            Response.End();
        }
Exemple #4
0
        public void MaintainSave(string formdata)
        {
            Base_Codename_Method bcm = new Base_Codename_Method();

            string yearid = Request["ID"];
            //从前端获取值
            JObject json = (JObject)JsonConvert.DeserializeObject(formdata);

            string response = String.Empty;

            Sql.decl_HS by = new Sql.decl_HS();



            if (string.IsNullOrEmpty(json.Value <string>("ID")))
            {
                if (json.Value <string>("ENABLED") == "1")
                {
                    //查询是否有重复值
                    DataTable dt = by.check_repeat_base_insphs(json, yearid);
                    if (dt.Rows.Count > 0)
                    {
                        //当数据有重复时success返回值为4
                        response = "{\"success\":\"4\"}";
                    }
                    else
                    {
                        int i = by.insert_base_insphs(json, yearid);
                        response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                    }
                }
                else
                {
                    int i = by.insert_base_insphs(json, yearid);
                    response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                }
            }
            else
            {
                if (json.Value <string>("ENABLED") == "1")
                {
                    DataTable dt = by.check_repeat_base_insphs_update(json, yearid);
                    //判断是否有重复值
                    if (dt.Rows.Count > 0)
                    {
                        //当数据有重复时success返回值为4
                        response = "{\"success\":\"4\"}";
                    }
                    else
                    {
                        //获取修改之前的记录
                        DataTable getChanges = by.Before_Change(json);
                        int       i          = by.update_base_insphs(json, yearid);
                        if (i > 0)
                        {
                            //获取修改的内容
                            string content = bcm.getChangeHsCode2(getChanges, json);
                            by.saveChangeBaseHsCode(json, content);
                            response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                        }
                    }
                }
                else
                {
                    //获取修改之前的记录
                    DataTable getChanges = by.Before_Change(json);
                    int       i          = by.update_base_insphs(json, yearid);
                    if (i > 0)
                    {
                        //获取修改的内容
                        string content = bcm.getChangeHsCode2(getChanges, json);
                        by.saveChangeBaseHsCode(json, content);
                        response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                    }
                }
            }
            Response.Write(response);
            Response.End();
        }
Exemple #5
0
        public void save(string formdata)
        {
            string response = String.Empty;

            Sql.decl_HS          by  = new Sql.decl_HS();
            Base_Codename_Method bcm = new Base_Codename_Method();
            //从前端获取值
            JObject json = (JObject)JsonConvert.DeserializeObject(formdata);

            if (string.IsNullOrEmpty(json.Value <string>("ID")))
            {
                //查询是否有重复值
                if (json.Value <string>("ENABLED") == "1")
                {
                    DataSet dt = by.check_base_year(json);
                    if (dt.Tables[0].Rows.Count > 0)
                    {
                        //当数据有重复时success返回值为4
                        response = "{\"success\":\"4\"}";
                    }
                    else
                    {
                        int i = by.insertTable(json);
                        response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                    }
                }
                else
                {
                    int i = by.insertTable(json);
                    response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                }
            }
            else
            {
                //查询是否有重复值
                if (json.Value <string>("ENABLED") == "1")
                {
                    DataSet dt = by.check_base_year_by_idandname(json);
                    if (dt.Tables[0].Rows.Count > 0)
                    {
                        //当数据有重复时success返回值为4
                        response = "{\"success\":\"4\"}";
                    }
                    else
                    {
                        DataTable data    = by.getBeforeChangData(json);
                        string    content = bcm.getChangeBase_year2(data, json);
                        int       i       = by.update_base_year(json);
                        if (i > 0)
                        {
                            //插入修改记录
                            by.insert_base_alterrecord(json, content);
                        }
                        response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                    }
                }
                else
                {
                    DataTable data    = by.getBeforeChangData(json);
                    string    content = bcm.getChangeBase_year2(data, json);
                    int       i       = by.update_base_year(json);
                    if (i > 0)
                    {
                        //插入修改记录
                        by.insert_base_alterrecord(json, content);
                    }
                    response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                }
            }

            Response.Write(response);
            Response.End();
        }
        public void save()
        {
            string  formdata = Request["formdata"];
            JObject json     = (JObject)JsonConvert.DeserializeObject(formdata);
            string  response = String.Empty;

            Sql.busi_UnitConvert bu = new Sql.busi_UnitConvert();
            Base_Codename_Method bm = new Base_Codename_Method();

            if (string.IsNullOrEmpty(json.Value <string>("ID")))
            {
                if (json.Value <string>("ENABLED") == "1")
                {
                    //需要判断
                    if (bu.check_repeat(json).Rows.Count > 0)
                    {
                        response = "{\"success\":\"4\"}";
                    }
                    else
                    {
                        int i = bu.insert_table(json);
                        response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                    }
                }
                else
                {
                    int i = bu.insert_table(json);
                    response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                }
            }
            else
            {
                if (json.Value <string>("ENABLED") == "1")
                {
                    if (bu.check_update_repeat(json).Rows.Count > 0)
                    {
                        response = "{\"success\":\"4\"}";
                    }
                    else
                    {
                        DataTable dt = bu.befor_change(json);
                        int       i  = bu.update_unitconvert(json);
                        if (i > 0)
                        {
                            string content = bm.getunitconvert(dt, json);
                            bu.insert_alert_data(json, content);
                            response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                        }
                    }
                }
                else
                {
                    DataTable dt = bu.befor_change(json);
                    int       i  = bu.update_unitconvert(json);
                    if (i > 0)
                    {
                        string content = bm.getunitconvert(dt, json);
                        bu.insert_alert_data(json, content);
                        response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                    }
                }
            }

            Response.Write(response);
            Response.End();
        }
Exemple #7
0
        private void save()
        {
            string  formdata = Request["formdata"];
            string  country  = Request["country"];
            JObject json     = (JObject)JsonConvert.DeserializeObject(formdata);

            Sql.busi_SpecialHsConvernet bsh = new Sql.busi_SpecialHsConvernet();
            string response         = String.Empty;
            Base_Codename_Method bm = new Base_Codename_Method();

            if (string.IsNullOrEmpty(json.Value <string>("ID")))
            {
                //查询是否有重复值
                if (json.Value <string>("ENABLED") == "1")
                {
                    if (bsh.check_repeat(json).Rows.Count > 0)
                    {
                        response = "{\"success\":\"4\"}";
                    }
                    else
                    {
                        int i = bsh.inser_specialhsconvert(json, country);
                        response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                    }
                }
                else
                {
                    int i = bsh.inser_specialhsconvert(json, country);
                    response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                }
            }
            else
            {
                if (json.Value <string>("ENABLED") == "1")
                {
                    if (bsh.check_update_repeat(json).Rows.Count > 0)
                    {
                        response = "{\"success\":\"4\"}";
                    }
                    else
                    {
                        DataTable dt = bsh.before_data(json);
                        int       i  = bsh.update_base_specialhsconvert(json, country);
                        if (i > 0)
                        {
                            string content = bm.getbasespecialhsconvert(dt, json, country);
                            bsh.insert_alert_record(json, content);
                            response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                        }
                    }
                }
                else
                {
                    DataTable dt = bsh.before_data(json);
                    int       i  = bsh.update_base_specialhsconvert(json, country);
                    if (i > 0)
                    {
                        string content = bm.getbasespecialhsconvert(dt, json, country);
                        bsh.insert_alert_record(json, content);
                        response = "{\"success\":" + (i > 0 ? "true" : "false") + "}";
                    }
                }
            }
            Response.Write(response);
            Response.End();
        }