public void DisconnectAll()
        {
            A01.Stop();
            A01.Disconnect();

            A02.Stop();
            A02.Disconnect();
        }
Exemple #2
0
 public void Add(A01 a01)
 {
     using (ISession session = NHibernateHelper.OpenSession())
     {
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.Save(a01);
             transaction.Commit();
         }
     }
 }
        public void ConnectAll()
        {
            if (A01.Connect("192.168.10.121:502", 1000))
            {
                A01.Start(1000);
            }

            if (A02.Connect("192.168.10.111:502", 1000))
            {
                A02.Start(1000);
            }
        }
Exemple #4
0
        /// <summary>
        ///  导入数据
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public bool ImportPersonData(DataTable dt, string UnitID, string RowID)
        {
            if (null == dt || dt.Rows.Count <= 0)
            {
                return(false);
            }
            List <A01> a01 = DBSession.IA01DAL.Select(s => s.UnitID.Equals(UnitID));

            if (null == a01 || a01.Count <= 0)
            {
                return(false);
            }
            //删除之前的模板数据
            DBSession.IWGJG02_TemplateDAL.Delete(s => s.WGJG01RowID.Equals(RowID));
            WGJG01_Template wg1 = DBSession.IWGJG01_TemplateDAL.Select(s => s.RowID == RowID).FirstOrDefault();

            foreach (DataRow item in dt.Rows)
            {
                A01 temp = a01.Where(s => s.PersonID.Equals(item["F5"])).FirstOrDefault();
                if (null == temp)
                {
                    continue;
                }
                decimal W0178 = 0, //应发
                        A0178 = 0; //实发
                try{
                    W0178 = Convert.ToDecimal(item["F3"]);
                    A0178 = Convert.ToDecimal(item["F4"]);
                }
                catch
                { W0178 = 0; A0178 = 0; }
                Add(new WGJG02_Template()
                {
                    RowID          = EncryptHelper.Md5Encryption(OnlyCodeHelper.CreateOnlyCode()),
                    WGJG01RowID    = RowID,
                    PersonSalaryID = EncryptHelper.Md5Encryption(OnlyCodeHelper.CreateOnlyCode()),
                    PersonID       = temp.PersonID,
                    A0101          = temp.A0101,
                    A0177          = temp.A0177,
                    B0002          = "",//item.B0002,
                    UnitID         = temp.UnitID,
                    E0386          = temp.E0386,
                    WGJG0203       = wg1?.WGJG0203,
                    WGJG0204       = temp.A0178, //工资
                    WGJG0207       = W0178,      //应发
                    WGJG0208       = A0178       //实发
                });
            }
            return(true);
        }
Exemple #5
0
 private void hideEverything()
 {
     A00.Hide();
     A01.Hide();
     A02.Hide();
     A10.Hide();
     A11.Hide();
     A12.Hide();
     A20.Hide();
     A21.Hide();
     A22.Hide();
     lbl_actualPlayer.Hide();
     lbl_draw.Hide();
     lbl_X.Hide();
     lbl_Y.Hide();
     bttn_changeName.Hide();
     bttn_newGame.Hide();
     bttn_reset.Hide();
     bttn_close.Hide();
 }
Exemple #6
0
        public ActionResult ArchiveDetail(string PersonID)
        {
            bll = operateContext.bllSession;
            A01 user = bll.A01.GetBySmCodeItem(bll.A01.GetByPersonID(PersonID));

            ViewBag.title        = "人员详细信息";
            ViewBag.persondetail = user;
            ViewBag.Content      = HCQ2_Common.JsonHelper.objectToJsonStr(user);

            string personPhoto = "";

            if (user.PersonPhoto != null)
            {
                string image       = "File/ReadPhoto/" + user.A0101;
                byte[] PersonPhoto = user.PersonPhoto;
                string str         = HCQ2_Common.ImageHelper.CreateImageFromBytes(HttpContext.Server.MapPath(image), user.A0101, PersonPhoto);
                personPhoto = image + "/" + str;
            }
            ViewBag.photo = personPhoto;

            return(View());
        }