Inheritance: Operation
Ejemplo n.º 1
0
        private void initConfig()
        {
            ord = new OrOperation();

            fEdit  = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Regular);
            fEditB = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Bold);

            C1ThemeController.ApplicationTheme = ic.iniC.themeApplication;
            theme1.Theme = C1ThemeController.ApplicationTheme;
            theme1.SetTheme(sB, "BeigeOne");
            foreach (Control c in panel2.Controls)
            {
                theme1.SetTheme(c, "Office2013Red");
            }

            bg = txtGiagGrpCode.BackColor;
            fc = txtGiagGrpCode.ForeColor;
            ff = txtGiagGrpCode.Font;

            btnNew.Click  += BtnNew_Click;
            btnSave.Click += BtnSave_Click;
            btnEdit.Click += BtnEdit_Click;
            ic.ivfDB.ordgDB.setC1CboDiagGroup(cboFetDay);

            initGrfPosi();
            setGrfPosi();
            setControlEnable(false);
            setFocusColor();
            sB1.Text = "";
            btnVoid.Hide();
            txtPasswordVoid.Hide();
            stt = new C1SuperTooltip();
            sep = new C1SuperErrorProvider();
        }
Ejemplo n.º 2
0
        public void getlOrDiag()
        {
            //lDept = new List<Position>();

            lDept.Clear();
            DataTable dt = new DataTable();

            dt = selectAll();
            foreach (DataRow row in dt.Rows)
            {
                OrOperation dept1 = new OrOperation();
                dept1.opera_id      = row[ord.opera_id].ToString();
                dept1.opera_code    = row[ord.opera_code].ToString();
                dept1.opera_code_ex = row[ord.opera_code_ex].ToString();

                dept1.opera_name = row[ord.opera_name].ToString();
                //dept1.remark = row[ordg.remark].ToString();
                //dept1.date_create = row[ordg.date_create].ToString();
                //dept1.date_modi = row[ordg.date_modi].ToString();
                //dept1.date_cancel = row[ordg.date_cancel].ToString();
                //dept1.user_create = row[ordg.user_create].ToString();
                //dept1.user_modi = row[ordg.user_modi].ToString();
                //dept1.user_cancel = row[ordg.user_cancel].ToString();
                dept1.active = row[ord.active].ToString();
                lDept.Add(dept1);
            }
        }
        public void should_not_work()
        {
            var orish = new OrOperation().GetPredicateBuilder<Contract>(c => c.Status, "open", c => c.Status, "closed");

            var contract = new Contract();
            contract.Status = "a";

            orish.Compile()(contract).ShouldBeFalse();
        }
        public void should_work_for_collections_and_other()
        {
            var orish = new OrOperation().GetPredicateBuilder<Contract>( c => c.Status, new List<string>{"open","closed"}, c=>c.Status, "x");

            var contract = new Contract();
            contract.Status = "x";

            orish.Compile()(contract).ShouldBeTrue();
        }
Ejemplo n.º 5
0
        public void should_not_work()
        {
            var orish = new OrOperation().GetPredicateBuilder <Contract>(c => c.Status, "open", c => c.Status, "closed");

            var contract = new Contract();

            contract.Status = "a";

            orish.Compile()(contract).ShouldBeFalse();
        }
Ejemplo n.º 6
0
        public void should_work_for_collections_and_other()
        {
            var orish = new OrOperation().GetPredicateBuilder <Contract>(c => c.Status, new List <string> {
                "open", "closed"
            }, c => c.Status, "x");

            var contract = new Contract();

            contract.Status = "x";

            orish.Compile()(contract).ShouldBeTrue();
        }
Ejemplo n.º 7
0
        public OrOperation selectByPk1(String copId)
        {
            OrOperation cop1 = new OrOperation();
            DataTable   dt   = new DataTable();
            String      sql  = "select ordg.* " +
                               "From " + ord.table + " ordg " +
                               //"Left Join t_ssdata_visit ssv On ssv.ssdata_visit_id = bd.ssdata_visit_id " +
                               "Where ordg." + ord.pkField + " ='" + copId + "' ";

            dt   = conn.selectData(conn.conn, sql);
            cop1 = setOrDiag(dt);
            return(cop1);
        }
Ejemplo n.º 8
0
        public String insertOrDiag(OrOperation p, String userId)
        {
            String re = "";

            if (p.opera_id.Equals(""))
            {
                re = insert(p, userId);
            }
            else
            {
                re = update(p, userId);
            }

            return(re);
        }
Ejemplo n.º 9
0
 private void setControl(String posiId)
 {
     ord                  = ic.ivfDB.ordDB.selectByPk1(posiId);
     txtID.Value          = ord.opera_id;
     txtGiagGrpCode.Value = ord.opera_code;
     txtGiagGrpName.Value = ord.opera_name;
     //cboFetDay.Value = ord.diag_group_id;
     ic.setC1Combo(cboFetDay, ord.opera_group_id);
     //txtPosiNameT.Value = agn.posi_name_t;
     //txtRemark.Value = agn.remark;
     //if (posi.status_doctor.Equals("1"))
     //{
     //chkSendtoOr.Checked = ord.status_or_diag_req.Equals("1") ? true : false;
     //chkOrUs.Checked = ord.status_or_us.Equals("1") ? true : false;
 }
Ejemplo n.º 10
0
        public String insert(OrOperation p, String userId)
        {
            String re  = "";
            String sql = "";

            p.active = "1";
            //p.ssdata_id = "";
            long chk = 0;

            p.date_modi      = p.date_modi == null ? "" : p.date_modi;
            p.date_cancel    = p.date_cancel == null ? "" : p.date_cancel;
            p.user_create    = p.user_create == null ? "" : p.user_create;
            p.user_modi      = p.user_modi == null ? "" : p.user_modi;
            p.user_cancel    = p.user_cancel == null ? "" : p.user_cancel;
            p.opera_code     = p.opera_code == null ? "" : p.opera_code;
            p.opera_code_ex  = p.opera_code_ex == null ? "" : p.opera_code_ex;
            p.opera_name     = p.opera_name == null ? "0" : p.opera_name;
            p.remark         = p.remark == null ? "" : p.remark;
            p.sort1          = p.sort1 == null ? "" : p.sort1;
            p.opera_group_id = long.TryParse(p.opera_group_id, out chk) ? chk.ToString() : "0";

            sql = "Insert Into " + ord.table + " Set " +
                  "" + ord.opera_code + " = '" + p.opera_code + "' " +
                  "," + ord.opera_code_ex + " = '" + p.opera_code_ex + "' " +
                  "," + ord.opera_name + " = '" + p.opera_name.Replace("'", "''") + "' " +
                  "," + ord.remark + " = '" + p.remark.Replace("'", "''") + "' " +
                  "," + ord.date_create + " = now() " +
                  "," + ord.date_modi + " = '" + p.date_modi + "' " +
                  "," + ord.date_cancel + " = '" + p.date_cancel + "' " +
                  "," + ord.user_create + " = '" + p.user_create + "' " +
                  "," + ord.user_modi + " = '" + p.user_modi + "' " +
                  "," + ord.user_cancel + " = '" + p.user_cancel + "' " +
                  "," + ord.active + " " + " = '" + p.active + "' " +
                  "," + ord.sort1 + " " + " = '" + p.sort1 + "' " +
                  "," + ord.opera_group_id + " " + " = '" + p.opera_group_id + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
Ejemplo n.º 11
0
        private OrOperation setOrDiag(DataTable dt)
        {
            OrOperation dept1 = new OrOperation();

            if (dt.Rows.Count > 0)
            {
                dept1.opera_id       = dt.Rows[0][ord.opera_id].ToString();
                dept1.opera_code     = dt.Rows[0][ord.opera_code].ToString();
                dept1.opera_code_ex  = dt.Rows[0][ord.opera_code_ex].ToString();
                dept1.opera_name     = dt.Rows[0][ord.opera_name].ToString();
                dept1.remark         = dt.Rows[0][ord.remark].ToString();
                dept1.date_create    = dt.Rows[0][ord.date_create].ToString();
                dept1.date_modi      = dt.Rows[0][ord.date_modi].ToString();
                dept1.date_cancel    = dt.Rows[0][ord.date_cancel].ToString();
                dept1.user_create    = dt.Rows[0][ord.user_create].ToString();
                dept1.user_modi      = dt.Rows[0][ord.user_modi].ToString();
                dept1.user_cancel    = dt.Rows[0][ord.user_cancel].ToString();
                dept1.active         = dt.Rows[0][ord.active].ToString();
                dept1.sort1          = dt.Rows[0][ord.sort1].ToString();
                dept1.opera_group_id = dt.Rows[0][ord.opera_group_id].ToString();
            }
            else
            {
                dept1.opera_id      = "";
                dept1.opera_code    = "";
                dept1.opera_code_ex = "";

                dept1.opera_name     = "";
                dept1.remark         = "";
                dept1.date_create    = "";
                dept1.date_modi      = "";
                dept1.date_cancel    = "";
                dept1.user_create    = "";
                dept1.user_modi      = "";
                dept1.user_cancel    = "";
                dept1.active         = "";
                dept1.sort1          = "";
                dept1.opera_group_id = "";
            }

            return(dept1);
        }
Ejemplo n.º 12
0
        private void initConfig()
        {
            ord                = new OrOperation();
            ord.opera_id       = "opera_id";
            ord.opera_code     = "opera_code";
            ord.opera_code_ex  = "opera_code_ex";
            ord.opera_name     = "opera_name";
            ord.opera_group_id = "opera_group_id";
            ord.remark         = "remark";
            ord.date_create    = "date_create";
            ord.date_modi      = "date_modi";
            ord.date_cancel    = "date_cancel";
            ord.user_create    = "user_create";
            ord.user_modi      = "user_modi";
            ord.user_cancel    = "user_cancel";
            ord.active         = "active";
            ord.sort1          = "sort1";

            ord.table   = "or_b_operation";
            ord.pkField = "opera_id";

            lDept = new List <OrOperation>();
            //getlDept();
        }
Ejemplo n.º 13
0
 protected VisitResult VisitOr(OrOperation operation)
 {
     return(VisitBinary(Expression.Or, operation));
 }
Ejemplo n.º 14
0
        static void Main(string[] args)
        {
            Console.WriteLine("Day 7");
            Console.WriteLine("Star 1");
            Console.WriteLine();

            string[]            lines      = File.ReadAllLines(inputFile);
            HashSet <WireValue> operations = new HashSet <WireValue>();

            foreach (string line in lines)
            {
                int    arrowIndex = line.IndexOf("->");
                string outputName = line.Substring(arrowIndex + 3);

                WireValue input = null;

                string[] splitInput = line.Substring(0, arrowIndex - 1).Split(' ');

                if (splitInput.Length == 1)
                {
                    //123 -> Y
                    //X -> Y
                    input = GetInput(splitInput[0]);
                }
                else if (splitInput.Length == 2)
                {
                    //NOT X -> Y
                    if (splitInput[0] != "NOT")
                    {
                        throw new Exception();
                    }

                    input = new NotOperation(GetInput(splitInput[1]));
                }
                else if (splitInput[1] == "AND")
                {
                    input = new AndOperation(GetInput(splitInput[0]), GetInput(splitInput[2]));
                }
                else if (splitInput[1] == "OR")
                {
                    input = new OrOperation(GetInput(splitInput[0]), GetInput(splitInput[2]));
                }
                else if (splitInput[1] == "RSHIFT")
                {
                    input = new RShiftOperation(GetInput(splitInput[0]), int.Parse(splitInput[2]));
                }
                else if (splitInput[1] == "LSHIFT")
                {
                    input = new LShiftOperation(GetInput(splitInput[0]), int.Parse(splitInput[2]));
                }
                else
                {
                    throw new Exception();
                }

                SafeGetWire(outputName).input = input;

                operations.Add(input);
            }

            Wire wireA = SafeGetWire("a");

            int output1 = wireA.GetValue();

            Console.WriteLine($"The answer is: {output1}");



            Console.WriteLine();
            Console.WriteLine("Star 2");
            Console.WriteLine();

            //Reset cached values
            foreach (WireValue wireValue in wires.Values)
            {
                wireValue.Reset();
            }

            foreach (WireValue wireValue in operations)
            {
                wireValue.Reset();
            }


            wires["b"].input = new FixedWireValue(output1);


            Console.WriteLine($"The answer is: {wireA.GetValue()}");

            Console.WriteLine();
            Console.ReadKey();
        }
Ejemplo n.º 15
0
 public void VisitOrOperation(OrOperation node) => InferConditionalOperationType(node);
        public string Visit(OrOperation operation)
        {
            Contract.RequiresNotNull(operation, "operation != null");

            return($"({Visit(operation.LeftSide)} or {Visit(operation.RightSide)})");
        }
Ejemplo n.º 17
0
 public void VisitOrOperation(OrOperation node)
 {
     throw new NotImplementedException();
 }