示例#1
0
        public virtual void getApplyTo <T, P>()
            where T : class
            where P : class
        {
            string message;

            try
            {
                string record = this.Request["record"];

                Hashtable ht = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                List <vw_employment> empParameters = JavaScriptConvert.DeserializeObject <List <vw_employment> >(ht["empparams"].ToString());
                P obj = JavaScriptConvert.DeserializeObject <P>(ht["objparams"].ToString());

                T       bll     = (T)typeof(T).GetConstructor(new Type[] { }).Invoke(new object[] { });
                BaseBll baseBll = bll as BaseBll;

                baseBll.ApplyTo(empParameters, obj);

                message = "{status:'success',msg:'" + HRMSRes.Public_Message_AddWell + "'}";

                Response.Write(message);
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }