Ejemplo n.º 1
0
        public static string Add_Fwx_other(DataSet DS_Fwx_other_temp, string yydh)
        {
            string s = common_file.common_app.get_failure;

            if (DS_Fwx_other_temp != null && DS_Fwx_other_temp.Tables[0].Rows.Count > 0)
            {
                Model.Fwx_other M_Fwx_other = new Model.Fwx_other();
                BLL.Fwx_other   B_Fwx_other = new BLL.Fwx_other();
                string          strlsbh_ds  = ""; //记录总的lsbh以“,”号隔开
                foreach (DataRow dr in DS_Fwx_other_temp.Tables[0].Rows)
                {
                    string strLsbh = dr["lsbh"].ToString();

                    M_Fwx_other.yydh = dr["yydh"].ToString();
                    M_Fwx_other.qymc = dr["qymc"].ToString();
                    M_Fwx_other.lsbh = dr["lsbh"].ToString();
                    M_Fwx_other.fjrb = dr["fjrb"].ToString();
                    M_Fwx_other.fjbh = dr["fjbh"].ToString();
                    M_Fwx_other.ddsj = Convert.ToDateTime(dr["ddsj"].ToString());
                    M_Fwx_other.lksj = Convert.ToDateTime(dr["lksj"].ToString());
                    M_Fwx_other.bz   = dr["bz"].ToString();
                    M_Fwx_other.zyzt = dr["zyzt"].ToString();
                    M_Fwx_other.czsj = Convert.ToDateTime(dr["czsj"].ToString());
                    M_Fwx_other.cznr = dr["cznr"].ToString();
                    M_Fwx_other.czy  = dr["czy"].ToString();
                    M_Fwx_other.shsc = true;

                    //如果有相同lsbh就修改,,然后添加。
                    DataSet ds = B_Fwx_other.GetList("lsbh='" + strLsbh + "'");

                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        int fid = Convert.ToInt32(ds.Tables[0].Rows[0]["id"].ToString());
                        M_Fwx_other.id = fid;
                        if (B_Fwx_other.Update(M_Fwx_other))
                        {
                            s = common_file.common_app.get_suc;
                        }
                    }
                    else
                    {
                        if (B_Fwx_other.Add(M_Fwx_other) > 0)
                        {
                            s = common_file.common_app.get_suc;
                        }
                    }
                    strlsbh_ds += "'" + strLsbh + "'" + ",";  //累加lsbh以“,”号相隔
                }
                s = common_file.common_app.get_suc;
                //相反不相等的话就删除,防止本地删除中央服务器还没有删除lsbh not in
                if (strlsbh_ds.Length != 0)
                {
                    strlsbh_ds = strlsbh_ds.Remove(strlsbh_ds.Length - 1, 1);
                    string strsql = "delete from Fwx_other where lsbh not in(" + strlsbh_ds + ") and yydh='" + yydh + "'";
                    DbHelperSQL.ExecuteSql(strsql);
                    s = common_file.common_app.get_suc;
                }
            }
            return(s);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 门店上传散客房间到中心服务器
        /// </summary>
        /// <returns></returns>
        public static int UpLoad_Qskyd_fjrb()
        {
            int    i = 0;
            string s = common_app.get_failure;

            Model.Qskyd_fjrb M_Qskyd_fjrb  = new Model.Qskyd_fjrb();
            BLL.Qskyd_fjrb   B_Qskyd_fjrb  = new BLL.Qskyd_fjrb();
            BLL.Fwx_other    B_Fwx_other   = new BLL.Fwx_other();
            DataSet          DS_Qskyd_fjrb = new  DataSet();
            DataSet          DS_Fwx_other  = new DataSet();

            DS_Qskyd_fjrb = B_Qskyd_fjrb.GetList("1=1");
            DS_Fwx_other  = B_Fwx_other.GetList("1=1");
            if (DS_Qskyd_fjrb != null && DS_Qskyd_fjrb.Tables[0].Rows.Count > 0)
            {
                object[] args = new object[2];
                args[0] = DS_Fwx_other;
                args[1] = DS_Qskyd_fjrb;
                object result = jdgl_res_head_app.DynamicWebServiceCall.InvokeWebService(url, "Qskyd_fjrb_temp_ADD", args);
                if (result.ToString() == common_file.common_app.get_suc)
                {
                    Common_Shsc.Updatshsc(DS_Qskyd_fjrb, "Qskyd_fjrb");
                    Common_Shsc.Updatshsc(DS_Fwx_other, "Fwx_other");
                    i += Common_Shsc.GetRowCount(DS_Qskyd_fjrb);
                    i += Common_Shsc.GetRowCount(DS_Fwx_other);
                    Common.AddMsg(DS_Qskyd_fjrb, "上传房间类别");
                    Common.AddMsg(DS_Fwx_other, "上传维修房");
                }
            }
            return(i++);
        }
Ejemplo n.º 3
0
        // id,yydh,qymc,lsbh,fjrb,fjbh,ddsj,lksj,bz,zyzt,czsj,cznr,czy,is_top,is_select,shsc
        public string Fwx_other_UploadDS(DataSet DS_Fwxother)  //άÐÞ·¿ÉÏ´«
        {
            DbHelperSQLP Helpsql = new DbHelperSQLP();
            string       s       = common_file.common_app.get_failure;

            BLL.Fwx_other   B_Fwx_other = new BLL.Fwx_other();
            Model.Fwx_other M_Fwx_other = new Model.Fwx_other();
            if (DS_Fwxother != null && DS_Fwxother.Tables[0].Rows.Count > 0)
            {
                string dsqymc = DS_Fwxother.Tables[0].Rows[0]["yydh"].ToString();
                DbHelperSQL.ExecuteSql("delete from Fwx_other where yydh='" + dsqymc + "'");
                foreach (DataRow dr in DS_Fwxother.Tables[0].Rows)
                {
                    SqlParameter[] parameters =
                    {
                        new SqlParameter("@yydh",      SqlDbType.VarChar,   50),
                        new SqlParameter("@qymc",      SqlDbType.VarChar,   50),
                        new SqlParameter("@lsbh",      SqlDbType.VarChar,   50),
                        new SqlParameter("@fjrb",      SqlDbType.VarChar,   50),
                        new SqlParameter("@fjbh",      SqlDbType.VarChar,   50),
                        new SqlParameter("@ddsj",      SqlDbType.DateTime),
                        new SqlParameter("@lksj",      SqlDbType.DateTime),
                        new SqlParameter("@bz",        SqlDbType.VarChar,   50),
                        new SqlParameter("@zyzt",      SqlDbType.VarChar,   50),
                        new SqlParameter("@czsj",      SqlDbType.DateTime),
                        new SqlParameter("@cznr",      SqlDbType.VarChar,   50),
                        new SqlParameter("@czy",       SqlDbType.VarChar,   50),
                        new SqlParameter("@is_top",    SqlDbType.Bit,        1),
                        new SqlParameter("@is_select", SqlDbType.Bit,        1),
                        new SqlParameter("@shsc",      SqlDbType.Bit, 1)
                    };
                    parameters[0].Value  = dr[1];
                    parameters[1].Value  = dr[2];
                    parameters[2].Value  = dr[3];
                    parameters[3].Value  = dr[4];
                    parameters[4].Value  = dr[5];
                    parameters[5].Value  = Convert.ToDateTime(dr[6]);
                    parameters[6].Value  = Convert.ToDateTime(dr[7]);
                    parameters[7].Value  = dr[8];
                    parameters[8].Value  = dr[9];
                    parameters[9].Value  = Convert.ToDateTime(dr[10]);
                    parameters[10].Value = dr[11];
                    parameters[11].Value = dr[12];
                    parameters[12].Value = Convert.ToBoolean(dr[13]);
                    parameters[13].Value = Convert.ToBoolean(dr[14]);
                    parameters[14].Value = true;
                    Helpsql.RunProcedure("Fwx_other_ADD", parameters);
                    s = common_file.common_app.get_suc;
                }
            }
            return(s);
        }